This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classpath " Watch "Classpath " New topic
Author

Classpath

Jumpy David
Greenhorn

Joined: Jan 17, 2001
Posts: 10
Hi!
I have set the classpath to C:\jdk1.2.2\lib. There is a jar file mail.jar in C:\jdk1.2.2\lib ...but it is not recognised by the classpath until and unless I explicitly include it in class path as C:\jdk1.2.2\lib\mail.jar. Why should it be so..? Do I need to put all the jar files in lib directory explicitly in the classpath to make them accessible.
Thanks and Regards,
Jumpy
Matthew Jones
Ranch Hand

Joined: Dec 21, 2000
Posts: 68
Yes, all jar files you create have to be included in the classpath statement if you want java to find them.
The CLASSPATH tells java where to looks for class files just like the PATH tells DOS to look for .bat, .exe, etc. files.
If you have the directory the jar file your class files are in included in the CLASSPATH, it will look in that directory for the class files, but won't look in the jar file unless you tell it to.
 
GeeCON Prague 2014
 
subject: Classpath