dcsimg
Dymaically setting path
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Venkat_P
Posted On:   Tuesday, September 11, 2001 03:40 AM


I want to dynamically set classpath, path from my java program. Pls tell me how to achieve this task.

Re: Dynamically setting path

Posted By:   Kevin_Riff  
Posted On:   Sunday, September 16, 2001 09:54 PM

You cannot affect these properties from your Java program. You can even overwrite the corresponding system properties, but you'll only succeed in confusing anyone who reads those properties.



If you need to load classes dynamically, then use a ClassLoader. Your custom class-loader can load classes from anywhere you like. If you want to alter the path so that you can load libraries dynamically, then override the findLibrary() method in your custom class-loader. There must be several FAQ entries that explain what to do.

About | Sitemap | Contact