The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

setting dynamic classpath or import statement

Posted by Preethi Mohan on October 23, 2001 at 6:58 AM

Hi
Even we tried with the setProperty and faced the same problem that is mentioned below.

Is there a way to dynamically set the import statement to a folder which is not added in the classpath??

Thank you,
Preethi

> We tried setting the classpath with setproperty method. The result was that when we checked the resulting classpath with getproperty method, it seemed that the classpath was updated ok. But when trying to use the classes via the new classpath in the same application, the classes were not found. It seems that the java virtual machine does read the class.path system property only upon jvm startup.

> Matti

>
> > hi,
> > Try using System class, There are methods like setproperty/getproperty etc... u can retrieve a class path using getproperty(java.class.path), so my guess is u can set the path using setproperty, check this out... only problem u may face is regarding permissions

> > > In one of my applications, I am trying to create folders at runtime
> > > and copy some .class files into these folders. folders are
> > > dynamically created with dynamic names. I want to include
> > > these folders in the classpath at runtime. How do i achieve this?






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us