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 classpath by setproperty does not work

Posted by Matti H�r� on October 16, 2001 at 6:39 AM

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