-1

Is it normal that whenever I debug a Java application that has a swing gui using Eclipse it fails to debug properly whenever it reaches a line that has something to do with swing.

Heres an example:

int number = 0; //Debugs fine
textbox.setText(Integer.toString(number)); //Takes me to this window saying "Source not Found"

Below is an image detailing what comes up when the debugger reaches a line that has something to do with the swing GUI:

Error Message

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
Andrei0427
  • 573
  • 3
  • 6
  • 18
  • 1. Which version of Eclipse? 2. How do you get to the line? Did you se a breakpoint on it or did you get the with Step Over/Step Into? – Aaron Digulla Sep 10 '12 at 08:32
  • @AaronDigulla I am using Eclipse v4.2 and yes, I used breakpoints and Step Into(F5) – Andrei0427 Sep 10 '12 at 08:35
  • This is not failure. It just does not finds source code in the path mentioned. If you say edit source lookup path and add src then it should not gives you such error. What ever version you are using it should not matter. – Prasad S Deshpande Sep 10 '12 at 08:59
  • 2
    Duplicate of http://stackoverflow.com/questions/6174550/eclipse-java-debugging-source-not-found – Prasad S Deshpande Sep 10 '12 at 09:30

2 Answers2

3
  1. Make sure you have a JDK installed; there should be a file src.zip in the root folder of your Java installation. Without that, Eclipse can't find the sources.

  2. Make sure Eclipse picks up the sources. There must a tiny overlay over the JARs in the JRE definition dialog for the first 5 entries or so. The more important one is rt.jar

enter image description here

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
1

There may be chance that you have put the your debug Break Point on source class too. i would like you to follow the following suggestion.

  • Go to window
  • go to souce view
  • choose break point from there
  • once it is opened then click on double close icon on top of break point. then all break point are flush try new break point for debugging

i hope this will work for you.

Dinup Kandel
  • 2,457
  • 4
  • 21
  • 38