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
posted 15 years ago
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.