I'm trying to run a regular .jar not runable .jar file using a .bat file
The jar file is named mytest.jar
, and I'm trying to execute it using in the .bat file:
java -classpath "mytest.jar"
and it doesn't work.
I'm trying to run a regular .jar not runable .jar file using a .bat file
The jar file is named mytest.jar
, and I'm trying to execute it using in the .bat file:
java -classpath "mytest.jar"
and it doesn't work.
You need to put the -jar
flag.
Use:
java -jar /path/to/your/jar/mytest.jar
you need to use:
java -cp $CLASSPATH:/path/to/your/jar/mytest.jar YourMainClass
and on Windows,
java -cp %CLASSPATH%;/path/to/your/jar/mytest.jar YourMainClass