Hi,
I want to set the classpath at runtime, is there a method that aloows
setting/altering (or adding to) the classpath variable at runtime from code?
thanks in advance
lee
Oliver Wong - 16 Feb 2006 20:44 GMT
> Hi,
>
[quoted text clipped - 4 lines]
> thanks in advance
> lee
You could try System.setProperties(); but it sounds like your question
is too low-level (see
http://www.catb.org/~esr/faqs/smart-questions.html#goal) If your goal is to
change where the JVM searches for loading classes, you may be better off
writing a custom class loader.
- Oliver
Thomas Kellerer - 16 Feb 2006 22:30 GMT
L Clarke wrote on 16.02.2006 21:11:
> Hi,
>
[quoted text clipped - 3 lines]
> thanks in advance
> lee
You will need to use your own classloader. Have a look at URLClassLoader which
will probably do what you want to (load classes from jar files not present in
the classpath at JVM startup I assume)
Thomas
Roedy Green - 17 Feb 2006 05:08 GMT
>I want to set the classpath at runtime, is there a method that aloows
>setting/altering (or adding to) the classpath variable at runtime from code?
see http://mindprod.com/jgloss/classloader.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Stephen - 17 Feb 2006 10:42 GMT
System.setProperties() will not work.
try URLClassLoader
--
Regards;
Stephen