Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Inspect CLASSPATH inside the JVM

Thread view: 
ps2rox@gmail.com - 02 May 2006 19:56 GMT
Is possible to get the CLASSPATH using Java commands?

Blablabla.getClasspath() or something like this...

Thanks in advance.

Paulo Silvestre Schmitt.
Ferenc Hechler - 02 May 2006 20:04 GMT
ps2rox@gmail.com schrieb:
> Is possible to get the CLASSPATH using Java commands?
>
[quoted text clipped - 3 lines]
>
> Paulo Silvestre Schmitt.

The system-Property "java.class.path" contains the classpath.
Inside a jar this wont work, because the class-path defined
in the manifest is not set.
Perhaps you can find some info from the current ClassLoader?

Best regards,

   feri
Tony Morris - 02 May 2006 22:51 GMT
> ps2rox@gmail.com schrieb:
>> Is possible to get the CLASSPATH using Java commands?
[quoted text clipped - 13 lines]
>
>    feri

It will most definitely work - whether or not this meets the objective is
another matter.
Calling System.property("java.class.path") will always return the
java.class.path system property, regardless of any VM invocation properties.

Signature

Tony Morris
http://tmorris.net/

Ferenc Hechler - 04 May 2006 16:22 GMT
Tony Morris schrieb:
> Calling System.property("java.class.path") will always return the
> java.class.path system property, regardless of any VM invocation properties.
this is true, but if you write a manifest
containing "Class-Path: lib/abc.jar config/" and start the jar using
"java -jar my.jar" the java.class.path property is empty, thogh the
lib/abs.jar is loaded and config-files in config/ are found.
Which means the Jar-File Class-Loader does not only
look in the java.class.path

Best regards,

   feri
wpghost - 08 May 2006 15:17 GMT
This is exactly what I need.
Thank you guys!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.