how to run jar file in cmd

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

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

 

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

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

java -cp foo.jar full.package.name.ClassName