I would like to run a jar file right from the command line without having to put the jar file in the directory containing my input files. Any ideas on how I can do this if it is possible?
+2
A:
Wouldn't you just supply a class path argument when executing the class inside of the JAR? For example:
java -cp lib/somejar.jar org.foo.bar.MyClass
Where -cp is the classpath argument and lib/somejar.jar is the path to the jar you are trying to execute.
I'm not sure I'm clear on what you're looking for.
toddk
2009-02-04 17:05:38
Thank you. Sorry if I wasn't clear enough - wasn't aware that I could supply a class path argument.
Amara
2009-02-04 17:11:29
No problem - glad I could help. :-)
toddk
2009-02-04 19:37:01