Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath

 
Jumpy David
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic