• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2975
  • Last Modified:

Source not found

Hi, I am new to Eclipse, the version I use is 3.0. I have a project "classes", which contains a package "myFolder", and a servlet "myClass.java" in under "myFolder".

I wish to compile "myClass.java" in order to get myClass.class under myFolder. What I do to compile it, is by clicking on the debug button.(I can't find any compile option, so I choose debug instead, but is there any compile option?)

However, it prompts me a page called "Class File Editor"

The contents is
Source not found
The source attachment does not contain the source for the file URLClassLoader.class
You can change the source attachment by clicking Change Attached Source below:
...

How to deal with this situation?
0
william007
Asked:
william007
  • 6
  • 4
  • 2
  • +1
6 Solutions
 
avinthmCommented:
the class will be generated in myFolder . you dont have to compile it explicitly
0
 
objectsCommented:
eclipse supports auto compilation, look under Project menu
0
 
avinthmCommented:
<eclipse home>\workspace\classes\myFolder
i think u will find your class file "myClass.class" in above folder

<eclipse home> - is the path where u have installed eclipse
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
objectsCommented:
> I wish to compile "myClass.java" in order to get myClass.class under myFolder

goto your project setting>build path and set the output folder for your source folder
0
 
CEHJCommented:
If you look in your file system, you may find it's already compiled. As avinthm mentioned, compilation is done automatically by default
0
 
william007Author Commented:
Yes, thanks..I get the class.
But what is the error page about when I click on the debug button?
0
 
objectsCommented:
> But what is the error page about when I click on the debug button?

Its looking for the source to display in the debugger but doesn't know where it is
so it is asking you.
0
 
william007Author Commented:
Is the source refer to myClass.java?
When I click on the Change Attached Source button under it,
It prompts me a dialog and asks me to
"Select the location (folder, JAR or zip) containing the source for 'rt.jar',"
I select
C:/Program Files/Java/j2re1.4.2_05/lib/rt.jar,
After that I try to debug again,
the same problem still occur..

May I know how to solve it?
0
 
objectsCommented:
no its looking for URLClassLoader
point it as src.zip in the jdk base directory
0
 
CEHJCommented:
It's looking for a dependent class' source
0
 
william007Author Commented:
Thanks, I point it to src.zip, no error occur now.
My last question is may I know what is happening? Since src.zip contains all the source file(.java) for Java API, and it doesn't have any .class file that can be used..what eclipse trying to do with that src.zip?

Followed is the problem when I click on Run...
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21800641.html

And those are the related question
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21800638.html
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21800643.html
0
 
objectsCommented:
it needs them to display source during debugging.
the class file does not contain source, just byte code
0
 
william007Author Commented:
Fantastic, thanks:-)
0
 
objectsCommented:
no worries :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now