drmaa
drmaa

Reputation: 3684

How to enable java program to append specific path to classpath at program run time

I have made a front end for a program which test java (foo.class) binary file for errors. The problem is that to test the file the folder must be in claspath. Now in my front end the foo.class file can be selected from any where in hard disk using a browse button but I am unable to append the selected location to class path in order to run the test. Since that folder can be different for each run of program therefore it needs to be kind of dynamic. Thanks.

Upvotes: 0

Views: 266

Answers (1)

Attila
Attila

Reputation: 28772

It is not possible to modify the classpath the JVM was started with. What you could do is implement your own classloader that can use a dynamic classpath. See this SO thread for more details

Upvotes: 1

Related Questions