Just wondering is there any way to modify Classpath in your program and force them to include a new directory in classpath ??
javinpaul -6 Newbie Poster
peter_budo commented: Weak problem description, we do not like second guess -4
Recommended Answers
Jump to PostNot sure you can change it once the JVM has started.
Try it and see what happens.
You may need to build your own classloader that uses the paths you want it to use.
Jump to PostNot easily. Not directly.
Runtime.getRuntime().exec("set CLASSPATH=your desired path");
is not portable and while it sets the CLASSPATH environment variable in the child process, the child process immediately exits. You could set the CLASSPATH and run a program this way, but it's not portable.System.setProperty("java.class.path", System.getProperty("java.class.path") + File.pathSeparator + "/my/path");
does …
All 5 Replies
harinath_2007 56 Posting Whiz
NormR1 563 Posting Sage Team Colleague
JeffGrigg 170 Posting Whiz in Training
javinpaul -6 Newbie Poster
JeffGrigg 170 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.