Reputation: 563
There are already several 'Source not found' questions this forum. But none of them is like mine.
I try to debug ftp4j in eclipse and eclipse tells me 'Source not found'. i have already download the jar and source files.
I have set the source attachement of ftp4j.
eclipse debugging still need source. I surf here, it seem eclipse need something like junit-4.11-source.jar. if so , but there is not ftp4j-1.7.2-source.jar in ftp-1.7.2.zip.
If all my words are not wrong, can i make ftp4j-1.7.2-source.jar ? and how?
Upvotes: 0
Views: 729
Reputation: 786
What is going wrong The reason your source is not being recognized is because it is in a subfolder called src.
What you want a sources.jar file the same structure as the runtime file, but including the .java files in the same folders as the .class files were in the runtime jar.
Runtime jar
/packages/yourclasses.class
/package2/anotherclasses.class
Source jar
/packages/yourclasses.java
/package2/anotherclasses.java
To create this from the provided zip file,
Example command lines for windows with a JDK installed
jar xf ftp4j.zip
cd ftp4j-1.7.2\src
jar cf ftp4j-sources.jar .
A further note
If you don't have the source code, you can always add a de-compiler to eclipse.
See http://sourceforge.net/projects/jadclipse/
If you install this to your eclipse it sometimes helps when you don't have the original source code.
Of course sometimes you can't debug into the decompiled code, due to line numbers not matching up properly.
Upvotes: 1