File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classpath" Watch "Classpath" New topic


Sharda Vajjhala

Joined: Nov 12, 2001
Posts: 2
Can someone tell me how to set Classpath variable on NT? I need to set this for my java packages to work, but I don't know how to do it. I can see that there is a PATH environment variable. When I set the CLASSPATH as a user variable(using Control Panel->System settings), then when I go to DOS prompt and type Classpath, it gives an error message "the name specified is not recognized....etc etc"
Greg Brouelette
Ranch Hand

Joined: Jan 23, 2002
Posts: 144
If you're in a DOS window and you want to add it just for that session you can type (for example):
set classpath=.;C:\Dev_Projects\myjava
This will put C:\Dev_Projects\myjava AND whatever directory you are currently in (the dot) into teh classpath.
If you need to do this permanently then do this:
Right click the "My Computer" desktop icon and select "Properties". Select the "Advanced" tab and then the "Environment Variables".
Click one of the "New" buttons (depending on if youwant to add for this user or all users) and in the "Variable Name" field type "CLASSPATH". In the "Variable Value" field type your classpath.
Hope it helps.

For a good Prime, call:<br />29819592777931214269172453467810429868925511217482600306406141434158089
It is sorta covered in the JavaRanch Style Guide.
subject: Classpath
It's not a secret anymore!