Try this
java -jar
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 full.package.name.ClassName
See also instructions on how to create a manifest with an entry point:
https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html