This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including a jar file in your classpath

 
Steve Jensen
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really silly question folks, sorry about this.
How do I include a jar file in my classpath?
I'm using a PC running Windows 98 (second edition).
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SET CLASSPATH=C:\ADIRECTORY\ajarfile.jar;%CLASSPATH%
You would probably need to do that in your C:\AUTOEXEC.BAT file and then reboot the machine.
The %CLASSPATH% tells the system to put the "old" or "previous" value of the CLASSPATH at the end of the new CLASSPATH. If there was no previous CLASSPATH you can use SET CLASSPATH=C:\ADIRECTORY\ajarfile.jar;.
Note the semicolon and period at the end!
-Barry
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,
You can just drop a copy of the jar in your jre/lib/ext directory or you can append the fully qualified name to your CLASSPATH envrionment variable (eg C:\MyJars\MyClasses.jar) or you can build a classpath on most of the java utilities (like javac, java, etc.) with a -classpath flag like this:
javac -classpath .;C:\MyJars\MyClasses.jar source.java
Hope this helps,
Michael Morris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic