wood burning stoves 2.0*
The moose likes Java in General and the fly likes Setting System Class Path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Setting System Class Path" Watch "Setting System Class Path" New topic
Author

Setting System Class Path

Natraj Gudla
Ranch Hand

Joined: Feb 09, 2003
Posts: 34
Hi,
Using the System.setProperty(key,value) , i can change the class path of the system..But is it permanent, or till the program execuutes...as i have seen that the class path changed with the help of setProperty is non-existent after the program terminates....Is there any way by which i can effect the changes in the windows classpath...
Chris Treglio
Ranch Hand

Joined: Jun 18, 2001
Posts: 64
Changing the classpath system property absolutely does not change the environment variable $CLASSPATH / %CLASSPATH%. If you want a java program to change the classpath that other programs (or this one) will use in future executions you probably have to use some file I/O on the startup script of that program and change the -cp argument.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Setting System Class Path
 
Similar Threads
running exe files from JAR
diff between path & classpath
Java Beginner
class path
confuse in Class path ..?