H
horos11
This is probably a really simple one, but here goes:
I want to run a main method in a class file that is stored inside a
jar file, ie:
java -cp <jre>/demo/jpda/examples.jar com/sun/tools/example/trace/
Trace <my class to trace>
This works if I unjar the associated Trace class, but does *not* work
if I try to run it directly from the jar. I see that java provides a -
jar flag (to run a program from a jar) but that this requires a "Main-
Class" manifest attribute.
Obviously, I'm making it too difficult for myself, so exactly how does
one set up your environment so that you can run a main function from a
class packed up in a jar?
The ultimate output I'd want (which should be reproducible everywhere)
is to run:
java Trace
such that Trace is acquired from a CLASSPATH of
<jdk1.6.0_12>/demo/jpda/examples.jar
Thanks,
Ed
I want to run a main method in a class file that is stored inside a
jar file, ie:
java -cp <jre>/demo/jpda/examples.jar com/sun/tools/example/trace/
Trace <my class to trace>
This works if I unjar the associated Trace class, but does *not* work
if I try to run it directly from the jar. I see that java provides a -
jar flag (to run a program from a jar) but that this requires a "Main-
Class" manifest attribute.
Obviously, I'm making it too difficult for myself, so exactly how does
one set up your environment so that you can run a main function from a
class packed up in a jar?
The ultimate output I'd want (which should be reproducible everywhere)
is to run:
java Trace
such that Trace is acquired from a CLASSPATH of
<jdk1.6.0_12>/demo/jpda/examples.jar
Thanks,
Ed