File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting CLASSPATH

 
Mark Mokris
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do need to always set the CLASSPATH even through I am just working with one class in one directory, and that class is in my current directory?
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you always setting it using the
java -classpath ... method? If so you are only
setting it for a particular run of the JVM. You
can set you system's CLASSPATH variable so you
don't have to do this all the time.
For Windows 98(maybe 95 and ME too):
Start Menu>Run...>type in msconfig
Click on the autoexec.bat tab
Editthe text SET CLASSPATH=C:\PROGRA~1\JAVA\J2RE1.4.1_01\lib\rt.jar (or something close
at the end of this, put a ; (semicolon) and either type in the full path to where the .class is located OR type in a . (period)

For Windows 2000/XP:
Start Menu>Settings>Control Panel
System
Advanced Tab
Environment Variables
Find the CLASSPATH variable and edit as above
DOn't know about any other OS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic