This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Classpath variable in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Classpath variable in Eclipse" Watch "Classpath variable in Eclipse" New topic
Author

Classpath variable in Eclipse

Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 86
I have both Java 1.5 and Eclipse installed on my computer. When I try to execute a program using Eclipse, I get a message that says that it cannot find, C:\apps\Java\jre1.5.0_11/lib/tools.jar

I know that the file, tools.jar, is found in C:\apps\Java\jre1.5.0_11. Should I change the classpath variable from C:\apps\Java\jre1.5.0_11 to C:\apps\Java\jdk1.5.0_11? If so, how would I do that?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

(not sure about English menus)
In Windows->Settings...->Java->Installed JRE, make sure that your JRE is there. If it's not, add it.


[My Blog]
All roads lead to JavaRanch
Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 86
I already have JRE installed. My program is saying that it cannot find tools.jar in JRE. Is tools.jar supposed to be in JRE? I know that tools.jar is found in JDK. If the program is supposed to look for tools.jar in JDK, but not in JRE, how would I change that?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I already have JRE installed.

Does it point to your JDK ? (not JRE only) It should be associated to C:\apps\Java\jdk1.5.0_11
Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 86
I don't think it points to JDK. How would I make it point to it?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

In Windows->Settings...->Java->Installed JRE, click the Add... button. In JRE Home Directory, click the Search... button, and select your JDK directory (C:\apps\Java\jdk1.5.0_11). Give it the name you want, and click OK. Back to the Installed JRE window, check the JDK you have added (this will make it the default JRE for your projects.).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Classpath variable in Eclipse
 
Similar Threads
Ant script error in Websphere Application server 6.1
include tools.jar for JBoss ?
how to compile and run java??
classpath
About Tomcat