How to run a jar file in command prompt
June 23, 2017In this very short post, we will show how to run a jar file in command prompt. 1. -jar command To run a jar file you need use this command:
1 2 3 |
java -jar <jar-file-name>.jar |
2. -cp command Although, if you don’t have a manifest in your jar invoking java -jar command will not work. In that case, you should use -cp command:
1 2 3 |
java -cp foo.jar full.package.name.ClassName |