I have a jar file with several classes which have static main methods. Can I execute them inside the jar from the command line? If not, can I execute them one by one?
Windows
java -classpath .;path/to/yourlib.jar your.package.path.ClassWithMain
Linux (I guess)
java -classpath .:path/to/yourlib.jar your.package.path.ClassWithMain
Or if you don't use packages just do (for Windows)
java -classpath .;path/to/yourlib.jar ClassWithMain
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With