java - Run jar file in command prompt

ID : 10427

viewed : 24

Tags : javajarjava

Top 5 Answer for java - Run jar file in command prompt

vote vote


Try this

java -jar <jar-file-name>.jar 
vote vote


If you dont have an entry point defined in your manifest invoking java -jar foo.jar will not work.

Use this command if you dont have a manifest or to run a different main class than the one specified in the manifest:

java -cp foo.jar 

See also instructions on how to create a manifest with an entry point:

vote vote


java [any other JVM options you need to give it] -jar foo.jar

vote vote


You can run a JAR file from the command line like this:

java -jar myJARFile.jar 
vote vote


I would comment if i could , but i have no permissions yet, so i will post a hint as an answer, for unexpected behavior on some android devices:

Position: Fixed only works in Android 2.1 thru 2.3 by using the following meta tag:

<meta name="viewport" content="width=device-width, user-scalable=no">. 


Top 3 video Explaining java - Run jar file in command prompt