Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Anirban Chatterjee
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about
System.getProperty("java.class.path")
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic