Forums Register Login

a question about JDK CLasspath setting!

+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 517 times.
Similar Threads
new to java pls help
Problem compiling Servlet
new to j2ee1.4
Windows - XP: SET PATH
compiling problems
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:30:24.