• Post Reply Bookmark Topic Watch Topic
  • New Topic

a question about JDK CLasspath setting!  RSS feed

 
Daniel Washington
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i use the jbuilder,the message in the console
is :java **.java -classpath C:\****\rt.jar;
but some books tell me classpath=c:\adf\tools.jar;
I mean rt.jar and tools.jar is obviously different ,how can i have two choices.But it seems sometimes the latter setting can not work,and the first can do it .Do anybody have such experience?
thx a lot!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regardless of what any book says, you never should include rt.jar on the classpath when running any of the JDK tools (java, javac, etc.)
The file tools.jar contains the classes that implement some of the JDK tools themselves -- javac, rmic, etc; occasionally you may need to include it on the classpath, but only occasionally; only when you're doing something tricky, for the most part. If you don't know whether you need it or not, then you almost certainly don't.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i have two choices
I'm not exactly sure what you mean by this, but I'll guess that the purpose of the CLASSPATH setting might not be well understood. So, note that the CLASSPATH setting, is an environment variable that the Java compiler and runtime environment use to locate Java classes.
It's possible to specify many locations of Java classes - not just two.
Have you figured things out?
 
Daniel Washington
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply,
but i still don't know what is difference between the tools.jar and rt.jar,
I have been programming with the latter for a long time ,it seems all things is ok,until some guy asks me :why you use the rt.jar but book tell me to use the tools.jar.so ,i came to here to seek answer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!