tags:

views:

142

answers:

1

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
Thank you. Sorry if I wasn't clear enough - wasn't aware that I could supply a class path argument.
Amara
No problem - glad I could help. :-)
toddk