Quantcast
Channel: Run a JAR file from the command line and specify classpath - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Sid for Run a JAR file from the command line and specify classpath

$
0
0

Run a jar file and specify a class path like this:

java -cp <jar_name.jar:libs/*> com.test.App

jar_name.jar is the full name of the JAR you want to execute

libs/* is a path to your dependency JARs

com.test.App is the fully qualified name of the class from the JAR that has the main(String[]) method

The jar and dependent jar should have execute permissions.


Viewing all articles
Browse latest Browse all 6


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>