JADClipse not working with Eclipse 3.6 - java

Does Jadclipse work on Eclipse 3.6?
I have installed Jadclipse 3.3.0 on my Eclipse 3.6 by copying the jar into the plugins directory and restated eclipse.
Now I have the jadclipse menu under Windows->Preferences but when trying to de-compile any class it simply does not de-compile. I get the usual eclipse screen saying the source is unavailable. There are no errors in the Error Log.
Any idea?

I eventually found the answer here.
Running eclipse with -clean switch and setting the file association between *.class and the jadclipse plug-in solved the problem.

Set the JAD path correctly in Preferances>Java>Jad. Ex: D:\Jad\jad.exe
If still not working then,
Go to File extensions in Preferences. Select JadClipse as default editor for .class and .class with out source.

The main reason is that you eclipse have default class viewer configured for class file which you have to change to your new class decompiler.
go to preference > editor > choose "class without source" and select your tool and mark as default. will work for you :)

I had the same problem.
Just check if the JadEclipse Class File Viewer is the default viewer for "Class without source" in Preferences -> General -> Editors -> File Associations.

Download jad.exe and then in eclipse there are 2 places to configure.
Window->Preferences->java->JadClipse give the path of jad.exe in Path to decompiler
like C:\Users\Documents\xxx\jad.exe. then Apply
Window->Preferences->General->Editors->File Associations. Click on *.class and in below
dialog box there should be JadClipse Class File Viewer(default). If not click on Add...
add JadClipse as default file viewer.
Do the same for *.class without source as well.

I had the issues on mac with STS and was able to fix it with below process.
Download JADClipse plugin jar and copy it to plugins folder of Eclipse.
Download JAD decompiler and unzip it into a folder on your mac. Set java decompiler to JAD.
Eclipse->Preferences->Java->Decompiler->Select JAD
Eclipse->Preferences->Java->JADClipse->Path to decompiler (/Users/test/Desktop/JavaDecompiler/jad158g.mac.intel/jad)
Select file associations for .class and .class with out source to default JADClipse class viewer.
Restart Eclipse and it should work.
References -> http://hemantasapkota.github.io/posts/setting-up-jadclipse-and-jad-java-decompiler-in-eclipse/
https://eedannak.wordpress.com/2014/11/02/how-to-decompile-class-files-in-java-with-eclipse-ide/

Related

How can I link source to a jar package in eclipse?

How can I link source to a jar package in eclipse?
I am trying to add the external library ch.ntb.usb.
I added the jar file to my build path, but when I tried to run the application it returned the following error:
The jar file ch.ntb.usb has no source attachment.
I've used JD-GUI to decompile the jar file and the source code is contained.
I doubt that you get that error when you only run the project unless you have an error in your code and eclipse debugger try to show the line of code that cause the exception, anyway you may need source files of a library for debugging purpose, to link source to a jar package in eclipse you can follow these simple steps :
Find the package which you want to add the source under Referenced Libraries in Package Explorer
Right Click on the library
Select Properties
Go under Java Source Attachment
Select the directory or archive where your source is located.
I "Saved all sources" with jd-gui into my build path as ch.ntb.usb.src after unzipping the jar file. Then I set the source attachment of the external library to ch.ntb.usb.src. This fixed the issue.
I Know it is pretty late but it will be helpful for the other user, as we can do Job using three ways... as below 1)1. Atttach your source code using i.e, Right click on the project then properties --> Java build path--> attach your source in the source tab or you can remove jar file and attach the source in the libraries tab
2. Using eclipse source Analyzer In the eclipse market you can download the plugin java source analyzer which is used to attach the open source jar file's source code. we can achieve it after installing the plugin, by right click on the open source jar and select the attach source option.
3. Using Jadclipse in eclipse you can do it last not the least, you can achieve the decompile your code using this plugin. it is similar way you can download the plugin from the eclipse market place and install in your eclipse.
in jadclipse view you can see your .class file to decomplile source format note here you cannot see the comment and hidden things
Click right in Package Explorer your Project
Select Properties
Select Android
Scroll down
Under Library click Add
Select the needed Lib and press OK

Eclipse "Build Automatically" not cascading

I have a project in Eclipse (Indigo but similar in Helios) which has files in src/main/resources which get processed to generate *.java source files in target/generated-sources/xyz. The project settings have "Build Automatically" enabled so whenever these resource files are edited and saved the corresponding *.java files are generated. I've added target/generated-sources/xyz to the projects Build Paths. This all works perfectly.
The problem is that the changes to the generated *.java files are inconsistently rebuilt. If I have one of those files open in the editor, then it notices that it changed and asks if I want to reload it. Reloading the *.java files is enough for it to recognize that it has changed and trigger a rebuild. If I don't have it open then it doesn't automatically pick up the changes.
Any ideas on what I can do to let Eclipse (Indigo preferably) know that these generated files are being updated? Or better yet tell it to monitor those folders directly?
Thanks.
Try configuring Eclipse to automatically refresh. I'm not sure about Indigo, but in Helios, it's in Preferences → General → Workspace → Refresh Automatically.
Here it is in Indigo:
I assume you have added an "Program"-based builder to the project that compiles/translates the files into .java.
If you open the builder - via project properties -> Builders -> Edit... builder - then you can open the Refresh tab - se below.
Here you can then select which resources to refresh when this particular build is run... E.g. all resources in target/generated-sources/xyz...

How to get Java Decompiler / JD / JD-Eclipse running in Eclipse Helios

Java Decompiler (JD) is generally recommended as a good, well, Java Decompiler. JD-Eclipse is the Eclipse plugin for JD.
I had problems on several different machines to get the plugin running. Whenever I tried to open a .class file, the standard "Source not found" editor would show, displaying lowlevel bytecode disassembly, not the Java source output you'd expect from a decompiler.
Installation docs in http://java.decompiler.free.fr/?q=jdeclipse are not bad but quite vague when it comes to troubleshooting.
Opening this question to collect additional information: What problems did you encounter before JD was running in Eclipse Helios? What was the solution?
Here's the stuff I ran into:
1) RTFM and install the "Microsoft Visual C++ 2008 SP1 Redistributable Package" mentioned
at top of the installation docs. I missed this at first because the Helios instructions are at the end.
2) Close all open editor tabs before opening a class file. Otherwise it's easy to get an outdated editor tab from a previous attempt.
3) Open the class file in the "Java Class File Editor" (not "Java Class File Viewer"). Use "Open With" in the context menu to get the right editor. If pleased with results, make it the default editor in the File Association settings, in Window/Preference General/Editors/File Associations select *.class to open with "Java Class File Editor".
4) This guy recommends installing the Equinox SDK from the Helios update site. I did, but I'm not sure if this was really necessary. Anyone know?
5) If the class files you are trying to view are in an Eclipse Java project, they need to be in the project's build path. Otherwise, an exception ("Not in the build path") will show up in the Eclipse error log, and decompile will fail. I added the class files as a library / class file folder to the build path.
6) Drag/dropping a class file from Windows Explorer or opening it with File/Open File... will not work. In my tests, I gives a "Could not open the editor: The Class File Viewer cannot handle the given input ('org.eclipse.ui.ide.FileStoreEditorInput')." error. That is probably the wrong editor anyways, see 3).
7) After getting the plugin basically running, some files would still not decompile for an unknown reason. This disappeared after closing all tabs, restarting Helios, and trying again.
To Make it work in Eclipse Juno - I had to do some additional steps.
In General -> Editors -> File Association
Select "*.class" and mark "Class File Editor" as default
Select "*.class without source" -> Add -> "Class File Editor" -> Make it as default
Restart eclipse
The JD-eclipse plugin 0.1.3 can only decompile .class files that are visible from the classpath/Build Path.
If your class resides in a .jar, you may simply add this jar to the Build Path as another library. From the Package Explorer browse your new library and open the class in the Class File Editor.
If you want to decompile any class on the file system, it has to reside in the appropriate folder hierachy, and the root folder has to be included in the build path. Here is an example:
Class is foo.bar.MyClass in .../someDir/foo/bar/MyClass.class
In your Eclipse project, add a folder with arbitrary name aClassDir, which links to .../someDir.
Add that linked folder to the Build Path of the project.
Use the Navigator View to navigate and open the .class file in the Class File Editor. (Note: Plain .class files on the file system are hidden in the Package Explorer view.)
Note: If someDir is a subfolder of your project, you might be able to skip step 2 (link folder) and add it directly to the Build Path. But that does not work, if it is the compiler output folder of the Eclipse project.
P.S. I wish I could just double click any .class file in any project subfolder without the need to have it in the classpath...
I am using Eclipse 3.7 Indigo and Windows 7 64-bit:
What I did was to install the Microsoft Visual C++ 2008 SP1 Redistributable Package as suggested by the site and reminded by #Universalspezialist.
Then install the plugin as stated in the site: http://java.decompiler.free.fr/?q=jdeclipse
Go to preference, then find "File Associations"
Click on the *.class, then set the "class File Editor" as default.
Restart Eclipse perhaps? (I did this, but I'm not sure if it's necessary or not)
Simple thing i did to get it working:
Went in eclipse > Window > Preferences
(Optional)typed in the search box "file" to help trim the tree of options.
Went to General > Editors > File associations.
Clicked the ".class" type. Below there were 2 editors present, i clicked on the "Class File Editor" - the one with the icon from JD, clicked the "Default" button on the right.
Done.
Now all ur class are belong to us.
After testing on Juno, Kepler and Luna, I found JD only works for *.class files on build path.
Adding the jar as a lib of an existing project
Go to Preferences->General->Editors->File Associations, set *.class without source to Class File Editor with a cup icon
Its should work for all version of eclipse even in Spring tool suit(STS).
Here is the steps
Go to the URl
Follow The link to download or click the bellow link to direct download
Click Here to download
Download JD-Eclipse.
Download and unzip the JD-Eclipse Update Site,
Launch Eclipse,
Click on "Help > Install New Software...",
Click on button "Add..." to add an new repository,
Enter "JD-Eclipse Update Site" and select the local site directory,
Select extracted folder and give any name. I have given JDA.
and click ok.
Check "Java Decompiler Eclipse Plug-in",
Next, next, next... and restart Eclipse.
I use jadeclipse instead, because it can't work in 3.6/3.7 eclipse
Update site
http://webobjects.mdimension.com/jadclipse/3.6/
Intallation
http://5thcross.wordpress.com/2009/05/20/installing-jadclipse-in-eclipse/
JAD Decomplier plug-in for Eclipse version 3.x and 4.x.
update site: http://feeling.sourceforge.net/update
Steps:
Open Eclipse IDE.
Click Help->Install New software
Paste above URL and give name as JAD.
Select the Eclipse Class Decompiler
Click on Next and accept agreements
Install it.
Restart Eclipse and check now.
if you need to decompile standalone jar try JD-GUI by the same autor (of JD-Eclipse). It is a standalone application (does not need eclipse). It can open both *.class and *.jar files. Interesting enough it needs .Net installed (as do JD-Eclipse indeed), but otherwise works like a charm.
Find it here:
http://jd.benow.ca/
Regards,
I made the steps 1, 2, 3 and the 7. and I put the folder with the class files in the project build path (right click, properties, java build path, libraries, add class folder, create new folder, advanced>>, link to folder in the file system, browse,...) then restart eclipse.
Download the JD-Eclipse Update Site(github.com/java-decompiler/jd-eclipse)
Launch Eclipse,
Click on "Help > Install New Software...",
Click on button "Add..." to add an new repository,
Enter "JD-Eclipse Update Site" and select the local site directory,
Check "Java Decompiler Eclipse Plug-in",
Next, next, next... and restart Eclipse.
Just download the site from the JD page. I was able to install from a local site in the isntalled software section of eclipse.
Steps to add the Java Decompiler in Eclipse :
Open Eclipse IDE.
Click Help->Eclipse Marketplace Wizard
In Search tab find the JD (JD is keyword to get the Eclipse Class Decompiler)
Select the Eclipse Class Decompiler
Click on Install.
Restart Eclipse and check
I used Intellij or Android studio both are working awesome for decompiling purpose.
Internally Intellij following FernFlower Decompiler.

No projects are found to import - Helios eclipse

When downloading the 64 bit for Helios eclipse claims that there are no projects found to import - the file is swt-3.6-win32-win32-x86_64.zip
This should be fairly straight forward!!!!
On top of what Joe said:
The build path page is located in Properties (right click on project) -> Java Build Path. You can find the Libraries tab there.
I'd add one more step to the aforementioned workaround:
1) Extract the swt-3.6-win32-win32-x86.zip file (or another version, whichever you need)
2) The extracted folder contains 2 jar files swt.jar and swt-debug.jar
3) On the Java build path page of your project, open the Libraries tab. And add the swt.jar as an external jar.
4) Expand swt.jar on this tab, double click "Source attachment" and point to the archive named swt.zip (also comes in the top-level SWT archive), so that the javadoc will also be available for you.
And that's it - SWT should work like a charm from now on. Hope that helps.
There is a bug report on this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=318680
I tried the recommended workaround (included below), but could not find the build path page, nor the Libraries tab, referenced in the workaround.
Instead, I right-clicked on the HelloWorldSWT package (in the Package Explorer window), selected Build Path -> Add External Libraries, and selected the jar file swt.jar. As the tutorial warns, there were compile errors, so I selected Source -> Organize Imports. The program now compiles and runs, but does not do anything. Inserting System.out.println() statements shows that it dies in creating the new Display().
I don't know if this helps [anyone], but I figured I'd share what I've tried so far. If anyone has any suggestions, they would be welcome.
For reference, in case it matters, I'm running Eclipse Helios (3.6) on Mac OS X (64-bit).
Here's the aforementioned workaround:
Lakshmi Shanmugam 2010-07-02 11:16:01 EDT
The step to import the SWT project from the zip is no longer valid. The
cheatsheet needs to be updated.
Please follow the below steps:
1) Extract the swt-3.6-win32-win32-x86.zip file
2) The extracted folder contains 2 jar files swt.jar and swt-debug.jar
3) On the Java build path page of your project, open the Libraries tab. And add
the swt.jar as an external jar.
Can't confirm - I just downloaded said file from the download page with no problem.
Importing projects is a workbench activity and not related to the eclipse installation process. Try a fresh install of a full 64Bit platform (one of the distributions from eclipse.org).
I have the same problem. There are instructions in the SWT HelloWorld tutorial linked from the Helios welcome page that instruct the user to first import the SWT project using File > Import ... then selecting Existing Projects into Workspace. When you specify the SWT archive, you get the error mentioned above "no projects found to import"
I think the problem is that the tutorial needs to be updated to reflect the fact that this archive is not an eclipse project and so cannot be imported in this fashion.
While it cannot be imported as a project, the jar can be linked; or, the source files can be turned into an eclipse project and the otherwise erroneous instructions can be followed from there.

Eclipse classpath does not update changes in Project Properties

I am using Eclipse 3.4.1 Build M20080911-1700
I have tried to change the classpath directories for jar and the source directory using the Project Properties -> Java Build Path -> Libraries Tab or Source Tab. When I click OK button and then return to the properties page, my changes were not applied.
I have to resort in the work around by manually changing the eclipse ".classpath" project settings file.
Any ideas?
Is the .classpath file checked into source control? You may not be able to change it if you don't have it checked out.

Categories

Resources