The moose likes Beginning Java and the fly likes Setting Classpath/path in WindowsNT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Setting Classpath/path in WindowsNT" Watch "Setting Classpath/path in WindowsNT" New topic

Setting Classpath/path in WindowsNT

zaeem masood ashar
Ranch Hand

Joined: Mar 17, 2001
Posts: 54

Can anybody tell me how do i set path and classpath settings working in WINDOWS NT 4.0

sai challa
Ranch Hand

Joined: Feb 06, 2001
Posts: 54
Originally posted by zaeem masood ashar:

Can anybody tell me how do i set path and classpath settings working in WINDOWS NT 4.0

1.Double click on MyComputer icon
2.Click on Control-Panel icon
3.Double click on System icon
4.Click the Environment tab
5.Under the user variables set Path=c:\java_home(where you installed java)\bin;%PATH%
6.Set ClassPath=c:\java_home\lib;.;(or the classpath specified by the product you want to install)
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
I wrote a bat file so that only the path and classpath for a given dos window could be changed (actually appends the paths to the Windows NT environment's paths). The reason being, where I work they replace the environment settings with their own profile each time we login. The effect is, you change the environment paths and everything works, but once you log back in the path and classpath along with all the other environment value are replaced with the co. profile values. It took me a bit of head scratching to figure out what the heck was going on. My request for a different environment setup was rejected, they want everyone the same.
If this happens to you or you don't want to change your environment setting, you can use the following bat file each time you want to do some java. Just put it in the dir where you keep you java source and run it before you do any compiling or executing. When you close the dos window the path and classpath will be discarded. Also the windows environment is not effected, meaning even though you have changed (appended) the paths on the dos-window Windows itself has its original paths in its environment. If you open other dos windows they will have the Windows NT environment's paths not your new paths.
If you use this, modify the path and classpath in the bat file to meet you needs.
@echo *****************************************************
@echo Temp Set-up for Java
@echo PATH and CLASSPATH are set only for this DOS window.
@echo *****************************************************
@echo Off
SET PATH=%PATH%;C:\your_jdk_version\bin;D:\your_java_source
SET CLASSPATH=C:\your_jdk_version\lib\;.;
REM ----------------
I agree. Here's the link:
subject: Setting Classpath/path in WindowsNT
It's not a secret anymore!