As you know, from command line, you can do like
java -classpath c:\myapp\my.jar;. test
to run the application "test" which will access the class
But I want to acess any class in a new jar files added to this current directory without stopping the application.
I tried to use System.setProperty("java.class.path","....")
to update the classpath after I get the jar file name using File.list(). The property -"java.class.path" - was set correctly. But I failed to do "Class.forName(...)" for the
class name in the jar file.
It looks like that SETTING classpath on fly doesn't help me
to access the class in JAR.
I tried ClassLoader as well - no help.
Could anyone tell me it is possible to do this or how to do this?
Thanks for your kind help.