3

It seems to be that there are two different ways of attaching source jar to a java library in eclipse:

  1. Right-click on jar file in Referenced Libraries, then click on Properties > Java Source Attachment.

  2. Go to Debug Configuration, then click on Source > Add... > Achieve

But it appears that I need to do both for eclipse to behave properly. If I do step 1 only, then I can see the source code, but if I put a breakpoint in the source and start the debugger then it says source code missing. If I do step 2 only, then it shows the code while debugging but not if I press F3 in a library method.

Why does eclipse require that the source code path be specified twice? Am I missing something?

Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
Saeid Nourian
  • 1,606
  • 15
  • 32
  • I don't know the real answer, but I think it may be related with [debug information](http://stackoverflow.com/questions/5746894/what-does-the-javac-debugging-information-option-gvars-do) – guleryuz Feb 01 '16 at 22:01
  • For what library are you setting the `Java Source Attachment` that's getting forgotten, and how is it added to the `Java Build Path`? – nitind Feb 01 '16 at 23:04
  • @glueryuz, it has nothing to do with debug information. All debug information are already present in the compiled jar library because I can step into them line by line after attaching source. – Saeid Nourian Feb 02 '16 at 18:09
  • @nitind, it's for jogl library but it doesn't matter because all libraries have same problem. I include the jar file in a lib folder in my project, then add them to Java Build path by right-clicking > Build Path > Add to Build Path... – Saeid Nourian Feb 02 '16 at 18:11

0 Answers0