dcsimg
How to modify Classpath at runtime
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ashok_kumar
Posted On:   Wednesday, July 31, 2002 08:23 AM

I am going to create/copy new jar files into different directory structure in a known directory,while running my sample application,which need to execute the classes that are created/copied during runtime of sample application,as I don't know the directory structure (I know the default directory where the jar files copied), I couldn't able to load the classes from jar file and cannot execute the classes. ex: My Sample application is in c:sample directory new jars created in c:samplejars directory with its own directory heirarchy. Execution command as:java com.xyz.Sample new jar created as myappapplication.jar in to the di   More>>


I am going to create/copy new jar files into different

directory structure in a known directory,while running my
sample application,which need to execute the classes
that are created/copied during runtime of sample

application,as I don't know the directory structure

(I know the default directory where the jar files copied),

I couldn't able to load the classes from jar

file and cannot execute the classes.

ex: My Sample application is in c:sample directory

new jars created in c:samplejars directory with its own directory heirarchy.

Execution command as:java com.xyz.Sample

new jar created as myappapplication.jar in to the
directory c:samplejars(i.e finally path is c:samplejarsmyappapplication.jar).

The com.xyz.Sample now has to update classpath at runtime

to c:samplejarsmyappapplication.jar,which may has

to be changed again when there is another jar created accordingly.

   <<Less

Re: How to modify Classpath at runtime

Posted By:   d_aemon  
Posted On:   Tuesday, August 6, 2002 01:21 AM

I think it is unable to change classpath at runtime. The only chance is to create Your own ClassLoader derived class(es) and manage new JAR files yourself. I did it in my application in which I manage plug-in modules at runtime with no noticeable problem.

d.aemon
About | Sitemap | Contact