File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to get the classpath inside a class of an executable jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get the classpath inside a class of an executable jar" Watch "How to get the classpath inside a class of an executable jar" New topic
Author

How to get the classpath inside a class of an executable jar

Anirban Chatterjee
Greenhorn

Joined: Feb 06, 2001
Posts: 18
I have an executable jar where I specify the classpath inside the MANIFEST , its runs fine .<br>
I need to get hold of this class-path inside my code (I have to spawn a new process and hand over this classpath to it )<br>
Any idea how I can get hold of this classpath -(apart from the crude method of reading the manifest entry )<br>
Thanks a lot,<br>
Anirban
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133
How about
System.getProperty("java.class.path")


Jon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the classpath inside a class of an executable jar