Ron
Ron

Reputation: 563

eclipse debugging 'source no found'

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.

enter image description here

I have set the source attachement of ftp4j.

Edit Source Lookup  Path 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

Answers (1)

Tinman
Tinman

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,

  • extract the source
  • go into the src folder
  • create a -sources.jar 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

Related Questions