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.
Related
I added a Student.jar into my Build Path in my eclipse like this-
Right click on the project->BuildPath->Configure Build
Path->Libraries->Add External Jars
There is one class named StudentTest in Student.jar file. When I was debugging my code in eclipse, I stepped into that StudentTest class in the Student.jar.
And after that eclipse shows me like this-
The JAR file S:\some_location\Student.jar has no source attachment.
You can attach the source by clicking Attach Source below
Now I am not sure how should I attach the source in my eclipse. And from where? Can anyone provide me step by step what I need to do.
Update:-
I tried unzipping the Student.jar and I got Student folder. And after that I tried pointing the source to Student folder But still I am not able to see the class properly so that I can debug it properly, it shows the same above behavior.
Use Java Source Attacher !
It does what eclipse should do - a right click context menu that says "Attach Java Source.
It automatically downloads the source for you and attaches it. I've only hit a couple libraries it doesn't know about and when that happens it lets you contribute the url back to the community so no one else will have a problem with that library.
Eclipse is showing no source found because there is no source available . Your jar only has the compiled classes.
You need to import the project from jar and add the Project as dependency .
Other option is to go to the
Go to Properties (for the Project) -> Java Build Path -> Libraries , select your jar file and click on the source , there will be option to attach the source and Javadocs.
A .jar file usually only contains the .class files, not the .java files they were compiled from. That's why eclipse is telling you it doesn't know the source code of that class.
"Attaching" the source to a JAR means telling eclipse where the source code can be found. Of course, if you don't know yourself, that feature is of little help. Of course, you could try googling for the source code (or check wherever you got the JAR file from).
That said, you don't necessarily need the source to debug.
This worked for me for Eclipse-Luna:
Right Click on the *.jar in the Referenced Libraries folder under your project, then click on Properties
Use the Java Source Attachment page to point to the Workspace location or the External location to the source code of that jar.
Go back in to where you added the jar. I believe its the libraries tab, I don't have Eclipse open but that sounds right. to the left of the jar file you added there should be an arrow pointing right, click that and 3 or 4 options expand, one of them being the source file of the library. Click on that and click edit(I think you can also double click it) then locate the file or folder on your hard disk, you probably have to click apply or okay and you're good to go, same with javadoc and i think the last one is native libraries. I don't pay much attention when I'm in there anymore if you couldn't tell. That's what you were asking, right?
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 I think in your scenario you can use the option one and option three, I prefer option three only if i want to the source code not for the debug the code. else i ll code the option 1, as i have the source already available with.
Simply import the package of the required source class in your code from jar.
You can find jar's sub packages in
Eclipse -- YourProject --> Referenced libraries --> yourJars --> Packages --> Clases
Like-- I was troubling with the mysql connector jar issue
"the source attachment does not contain the source"
by giving the path of source folder it display this statement
The source attachment does not contain the source for the file StatementImpl.class
Then I just import the package of mysql connector jar which contain the required class:
import com.mysql.jdbc.*;
Then program is working fine.
I faced the same issue and solved using the below steps. Go to Windows->preferences->Editors->File Associations
Here click on Add
then type .class
click on OK
again click on Add
then type .classwithoughtsource
click on OK
Now you will be able to see JadClipse option under Java section in Windows->Preferences
Please provide the path of jad.exe file as shown below.
Path for Decompiler-C:\Users\ahr\Documents\eclipse-jee-galileo-SR2-win32\jad.exe
Directory for temporary Files-C:\Users\ahr.net.sf.jadclipse
click on Apply
Now you should be able to see the classfiles in proper format.
It is quite possible, just go to the jar in the Build Path and choose to attach a source just like follow.
Download JDEclipse from http://java-decompiler.github.io/
Follow the installation steps
If you still didn't find the source, right click on the jar file and select "Attach Library Source" option from the project folder, as you can see below.
I am using project is not Spring or spring boot based application.
I have multiple subprojects and they are nested one within another.
The answers shown here supports on first level of subproject.
If I added another sub project for source code attachement, it is not allowing me saying folder already exists error.
Looks like eclipse is out dated IDE. I am using the latest version of Eclipse version 2015-2019.
It is killing all my time.
My intension is run the application in debug mode navigate through the sub projects which are added as external dependencies (non modifiable).
I have faced same problem and resolved it by using following scenario.
First we have to determine which jar file's source code we want along with version number. For Example "Spring Core" » "4.0.6.RELEASE"
open https://mvnrepository.com/ and search file with name "Spring Core" » "4.0.6.RELEASE".
Now Maven repository will show the the details of that jar file.
In that details there is one option "View All" just click on that.
Then we will navigate to URL "https://repo1.maven.org/maven2/org/springframework/spring-core/4.0.6.RELEASE/".
there so many options so select and download "spring-core-4.0.6.RELEASE-sources.jar" in our our system and attach same jar file as a source attachment in eclipse.
Try removing the breakpoints. :)
Presently I'm working with JavaFX. Whenever I hover over a method of JavaFX its gives me the following error:
'Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found'
How should I resolve this? How can I attach the javadoc or source so that I could see the description of the methods?
Download jar file containing the JavaDocs.
Open the Build Path page of the project (right click, properties, Java build path).
Open the Libraries tab.
Expand the node of the library in question (JavaFX).
Select JavaDoc location and click edit.
Enter the location to the file which contains the Javadoc (the one you just downloaded).
You can configure the Javadocs with downloading jar, basically javadocs will be referred directly from internet.
Complete steps:
Open the Build Path page of the project (right click, properties,
Java build path).
Open the Libraries tab.
Expand the node of the library in question (JavaFX).
Select JavaDoc location and click edit.
Enter the location to the file which contains the Javadoc.
Specifically for the javaFX javadoc enter http://docs.oracle.com/javafx/2.0/api/
for offline javadocs, you can download from : http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
After clicking Accept License Agreement you can download javafx-2_2_0-apidocs.zip
Neither Project/Properties/Javadoc Location nor Project/Properties/Java Build Path/Libraries had not helped me until I picked and moved up in "Order and Export" tab of "Java Build Path" "Android Dependencies" and added-in-library.jar. I hope it will be useful.
Alternatively you can also,
1) Navigate to that method by Ctrl+Click on the method. The new tab/window will opened with text "Source not found" and button "Attach Source.." in it
2) Click the button "Attach Source.."
3) New window pops up. Click the button "External Folder"
4) Locate the JavaFX javadoc folder. If you are on Windows with default installation settings, then the folder path is C:\Program Files\Oracle\JavaFX 2.0 SDK\docs
First, if you get the message
Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found
Then it means that you've already included the external jar needed for your project.
The next step would be to associate the external jar with its javadoc url.
go to package explorer, expand your project folder, expand referenced libraries
right click the external jar that you want to associate its javadoc with
click properties -> javadoc location
copy and past the url for the javadoc that you googled online into the javadoc location path
click apply
And you're all set!
Above all answers are right but there is another method also which is very handy.
Pre-condition: Your project is Maven project Or converts it to Maven project.
RightclickOnProject > Configuration > Convert in to Maven Project
- Now follow the steps:
1. Select any jar for which you want to download sources or javadocs.
2. RightClick > Maven > Download javadoc or Download javasources
I couldn't get the "Attach source..." method to work either, and I tried many different ways. The Javadocs for JavaFX are installed in Program Files\Oracle\JavaFX 2.x SDK\docs. Another way to install the Javadocs is:
Right click on the project, select Properties
Select Libraries on the right side of the tab
At the right top side of the tab, you may see "Default JavaFX Platform" or something similar. Click on the Manage Platforms button. (You can also install this default platform from here if you haven't got this already).
In the Java Platform Manager tab which appears, select "Default JavaFX Platform" on the left side, and then click on the JavaFX tab on the right side of the window.
One of the entry fields is labeled "JavaFX Javadoc". Click the "Browse" button next to this field and browse to the installed docs file mentioned above.
Hope this helps some people who were as puzzled as I was.
In addition to the answer of #dhroove
(would have written a comment if I had 50 rep...)
The link has changed to:
http://docs.oracle.com/javafx/2/api/
At least my eclipse wasn't able to use the link from him.
It already in a different thread, just a simple eclipse setting will automatically download JavaDoc (but, you need to click the method for first time).
Where can I download the JavaDoc for JPA 2.0?
This trick worked for me in Eclipse Luna (4.4.2): For a jar file I am using (htsjdk), I packed the source in a separate jar file (named htsjdk-2.0.1-src.jar; I could do this since htsjdk is open source) and stored it in the lib-src folder of my project. In my own Java source I selected an element I was using from the jar and hit F3 (Open declaration). Eclipse opened the class file and showed the button "Attach source". I clicked the button and pointed to the src jar file I had just put into the lib-src folder. Now I get the Javadoc when hovering over anything I’m using from the jar.
If you are using maven just do:
mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
You could specify the online Javadoc location for a particular JAR in Eclipse. This saved my day when I wasn't able to find any downloadable Javadocs for Kafka.
In the Package Explorer, right click on the intended JAR (under the project's Referenced Libraries or Maven Dependences or anything as such) and click on Properties.
Click on Javadoc Location.
In the Javadoc location path field under Javadoc URL, enter the URL of the online Javadocs, which most likely ends with /<version>/javadoc/. For example, Kafka 2.3.0's Javadocs are located at http://www.apache.org/dist/kafka/2.3.0/javadoc/ (you might want to change https to http in your URL, as it raised an invalid location warning after clicking on Validate... for me).
To attach the Java source code with Eclipse,
When you install the JDK, you must have selected the option to install the Java source files too. This will copy the src.zip file in the installation directory.
In Eclipse, go to Window -> Preferences -> Java -> Installed JREs -> Add and choose the JDK you have in your system.
Eclipse will now list the JARs found in the dialog box. There, select the rt.jar and choose Source Attachment. By default, this will be pointing to the correct src.zip. If not, choose the src.zip file which you have in your java installation directory.
java source attach in eclipse
Similarly, if you have the javadoc downloaded in your machine, you can configure that too in this dialog box.
I wanted to learn Java, as recommended by most of the people I downloaded "Thinking in Java" eBook and Source Code Example Lesson files from mindviewinc.com it's download location is this http://www.mindviewinc.com/TIJ4/CodeInstructions.html
These files don't work with Eclipse IDE for some reasons. So we have to build the files using the Build.xml file included in it's source code (Honestly, I do not have any idea what does "build" means here)
I tried building myself but of no use.. It did started building but after reaching some folder it stopped and gave error to install jboss-osgi-installer-1.0.0.jar .. After downloading it, I had no idea what to do with it, so I double clicked it and it asked me the location to install and I installed it in the default location, which was C:\Users\Username/jboss-osgi-1.0.0 and when I tried C:\Program Files\Java** the installation gave error that "this directory cannot be written, please choose another directory!" but anyway I installed it in the default location and it installed..
and again when I tried to build it, it gave me the same error and asked to Install Jboss....... I'm stuck.. This is happening again and again, wasted many days and didn't even crossed 100 pages of it's pdf because of this reason. It's a good eBook though.
I'm stuck in this from months... Please some one build it and make it like a project which could be easily and send me the project file, it would be really appreciated as I can not the solution to this anywhere on search engines..
Ok here's what I did to succesfully import the sources found in the "accesss" folder of you code samples:
Download the javassist jar as per Bruce's instructions, from here:
http://repo2.maven.org/maven2/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar
You must create an Eclipse project for the sources that are used as dependencies for most of the examples, that's the sources in the "net" folder:
in eclipse make new java project.
select the "net" directory, copy it, then in eclipse select the "src" entry in the project you just made, right click on it and select paste.
after eclipse finishes and auto-builds, it will complain about the missing javaassist jar. Right click on the project ->properties->java build path (on the left)->libraries (on the top)-> add external jars... (on the right), browse and select the javassist jar from where you down load it.
now the "net" project should be ok in eclipse
Now let's create the project for the sources in the "access" folder:
create a new java project in eclipse
Now, because Bruce structured his classes like crap, we'll have to make the proper structure in eclipse for them. This means:
a.create a new package called "access"
go to where your the access folder is on your drive, open it, select ONLY the folders (cookie2, desser, mypackage), copy them, then return to eclipse, right click on the "access" package u just made and click paste
now go back to the access dir on your drive, select ONLY the .java files (all of them, not the dirs), copy them, the back to eclipse, click on the src entry in the access project and click paste.
The access project in elcipse will still complain about missing classes form the "net" resouce. Right click on the project in eclipse->properties->java build path->projects (on the top)-> add(on the right)-> check the net project you created earlier-> click ok twice.
Now it should be ok
I hope you got the idea on how dependencies work in eclipse with this example.
For the other parts of you code samples, create separate java projects, add the classes to the proper package (create the packages if Bruce forgot to), and if you are missing external jars, go to http://search.maven.org search and download the jars. Good luck
"This code is designed to work outside of IDEs. Because packages are not introduced until later chapters, and some of the fancier IDEs like Eclipse require all code to be in packages, if you want to use the code inside those IDEs you will have to make some adjustments" - yep, bruce eckel would say that, cause that's the kind of guy he is. He also said there's ONLY checked exceptions in java, and asked for unchecked exeptions to be added as a bonus.
Now, if your sample code has no package, aka it's in the default package, aka when you look in the .java file, right at the top there's no line saying "package what.ever.bla" then all you have to do is:
-in Eclipse create a new Java se project
- open a windows explorer, go to your .java files, select them and copy them
- then in eclipse, right click the src folder in your project and chose "paste"
The files should be added to a "default" package in your eclipse project, without any error
Here is the simplest steps that I find to create a clean Eclipse project for the TIJ4 source code:
Download the source code zip from: http://www.mindviewinc.com/TIJ4/CodeInstructions.html, and unzip it to a folder, say 'TIJ4-code';
Download the additional libraries as in the previous URL, copy tools.jar from your current JDK's lib directory, and put them into TIJ4-code/lib;
Go into the 'TIJ4-code' folder, and run 'python Eclipse.py' (you need python installed on your system). This script adds the missing "package xxx" line to those source java files which don't yet have them, so as to make Eclipse happy. It also generates the Eclipse project files, which doesn't work well for some reason (beyond my limited knowledge on Eclipse), but they aren't needed here;
Open Eclipse and create a new empty java project, say with name 'TIJ4', choose JRE version 1.5, and "create separate folders for sources and class files";
Copy TIJ4-code/lib directory to your new Eclipse project folder;
Right click on the new project and select "Build Path" >> "Configure Build Path", then go to tab "Libraries", "add jars", then select all the jars under your project's lib folder;
Go to "File >> import", choose "General >> File System", select the unzipped folder 'TIJ4-code' as your "From directory". Check the root 'TIJ4-code' in the left panel of the import window, Click on "filter types" and select the .java, so that unnecessary files of other extensions, like *.class, *.py, *.xml, etc can be ignored during the import;
The zipped folder is no longer needed after the new Eclipse project is built. I hope you find this instruction helpful, and have fun learning TIJ4.
If you want to use this code in IDE rather than Eclipse and so on, for example in Intelij Idea or any other, the best way is to compile necessary classes from the TIJ4 with Ant, but it is not easy for the beginners, although it will be a good practice for you. You should make some changes in build.xml files which exists in every directory of TIJ4. Why?
to change version of Java(now we all use Java version higher than 1.5)
to include javaassist.jar library in the "classpath"
to put all compiled files in 'bin' directory(by default without adjustments TIJ4 build.xml puts .class files in the same directory with .java files. That is not a good deal.
For example you need to import and use within IDE(I use Intelij Idea) the class named net.mindview.util.Print ( see Chapter 3):
download TIJ4 and unzip in any directory you want(for example it would be c:\eckel)
download and install AntApache (you can find detailed instructions how to do it in Google) The result is - type in your console ant -version and you should see the answer. So Ant is working.
download javaassist.jar from http://jboss-javassist.github.io/javassist/ . Unzip to any directory, take out javassist.jar and past it to c:\eckel\net
4.There is build.xml file in c:\eckel\net. Now you should make adjustments. Open it with NotePad++ or other editor.
If you don't have Java 1.5 installed on your PC, so change all 'vesion1.5' to 'vesrion1.8' or other version that you have installed.
after tag description put property name = "classpath" value="./;./javassist.jar"/>
<property name = "src_util" value="./mindview/util"/>
<property name = "src_simple" value="./mindview/simple"/>
<property name = "src_atunit" value="./mindview/atunit"/>
<property name = "destdir" value="bin"/>
Then we make targets that will complile util simple or atunit automatically
Change tag available <available
classname="javassist.bytecode.ClassFile"
classpath="${classpath}"
property="javassist"
/>
Now classpath of available = property named 'classpath'. Classpath is the path where java compiler looks for .class files because some of your .java files want them by having import statement. There won't be error message "You must install the Javassist library " any more
Create targets for compiling util simple and so on See the following link with code
Code with targets
You can modify exists targets not to write all the code.
at the top of build.xml file change default="simple"
open cmd, then cd c:\eckel\net , then ant -simple or just ant (simple will run as default)
Please write if you will have some problems. Possibly i forgot mention about something.
Go to Intellij Idea, press Ctrl+Alt+Shift+S
Press +,
Library or directories
choose your c:\eckel\net\bin
5.now you can use import statement for all classes that exist in net.mindview
6.you can make the same with other dirs.
If you wish to you skip the entire Ant build process, I have converted the project to a Maven project (over JDK8), which you can simply import into your Eclipse workspace.
https://github.com/gauravojha/tij4-maven
Thanks to #Sergey Oliv's example. In addition, I needed to provide uncompiled javaassist package with all java files in the 'net' folder too. The .jar wouldn't work by itself.
I must say, this was a lot of work to get going.
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/
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.