Having some trouble adding a library path at runtime using the system. setproperty (Java. Library. Path) or system. setproperty (Java. Class. Path) or system. loadlibrary ()?
I have created a app which loads in classes via the classloader at runtime to run, but discovered some of these classes requires. jar files as well (extra library classes ). is there any way to just set. JAR file as a library at runtime ??? This cannot be done through adding it to the classpath at design time as I do not know the name of the class or. jar file until runtime.
You cocould write a custom class loader or use urlclassloader. See:
1) http://www.exampledepot.com/egs/java.lang/LoadClass.html
2) API documentation of the Java. Lang. classloader class.
3) http://www.javaworld.com/javaworld/jw-03-2000/jw-03-classload.html
4) http://forum.java.sun.com/thread.jspa? Threadid = 300557 & START = 0 & tstart = 0