2

While trying to debug a package in Eclipse with three classes in I get a "source not found" error and a "Edit Source Lookup Path" button is displayed....

I do not understand while this errors occurs and how to fix it - any ideas..?

The IDE I am using is Eclipse Java EE IDE for Web Developers - Java 1.6.

Regards Ian

smessing
  • 4,330
  • 1
  • 22
  • 19
Ian Carrick
  • 242
  • 3
  • 18
  • 1
    Hello and welcome to SO. Please give more details about your problem, what type of project are you trying to debug/run? Did you try a sample project first? – Cengiz Can Mar 04 '12 at 21:41
  • I first tried a simple console "Hello Word" app and this worked... – Ian Carrick Mar 04 '12 at 21:44
  • I then added three classes into the 'src' folder and in the file with "public static void(String [] args)" I create an object on one of the classes but it fails on the constructor... – Ian Carrick Mar 04 '12 at 21:45
  • The window showing this message should also show you which class it cannot find the source for. What kind of class is this? A class from the JRE? From a dependency jar? From the project you're running? – Arnout Engelen Mar 04 '12 at 23:37
  • possible duplicate of [Eclipse java debugging: source not found](http://stackoverflow.com/questions/6174550/eclipse-java-debugging-source-not-found) – Andrew Marshall Mar 08 '12 at 23:11
  • Try looking [here](http://stackoverflow.com/a/11452337/695116). It might help. – ssasa Jul 12 '12 at 13:06

1 Answers1

1

This usually happens because you're debugging into jars on your classpath that contain no source information. Alternatively, your code is referencing the artefacts of other Eclipse projects, and not the projects themselves.

To solve, add the projects / source jars when presented with the Edit Source Lookup Path dialogue.

Hope that helps!

Benemon
  • 73
  • 7
  • I have a single package with two classes - one class has the Void Main(String[] args) in and then creates a single object of the other class file - both files are in the same package and underlying system folder - I added the source folder into the project but this did not fix the issue... – Ian Carrick Mar 04 '12 at 22:51
  • Is Eclipse complaining about your classes (which if you've done what you've said, it shouldn't), or is it complaining about JDK classes? – Benemon Mar 05 '12 at 08:53