• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting java -classpath to the Class-Path: element of an executable jar MANIFEST.MF file  RSS feed

 
Riffle Chris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everybody,

I can't use "java -jar MyExecutableJar.jar" from a tool I'm using.

So, when you run a java class from the command line like this:

java -cp MyExecutableJar.jar my.example.MyMainClass

is it possible(if not already doing it) to get the java launcher to read the Class-Path: element of the MANIFEST.MF file inside MyExecutableJar.jar?

The tool I'm using that limits me is "JavaService" http://forge.ow2.org/projects/javaservice/

Thanks!
Chris




 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need the Class-Path from the JAR. If you use "java -cp file.jar" the JVM will already use the Class-Path from the JAR. The only thing you might want to retrieve from the JAR file is the Main-Class.
 
Riffle Chris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!