Open jar file with JRE on Mac

I have a jar file that is designed to run through the command line.

I do not plan to develop java on machines where the application will work, and my thought process is that I only need a JRE, not a JDK. In addition, the JDK is similar to 4x the size of a JRE, and I would not want to download it.

When installing JRE on Mac, it does not set the path for the java command, and if I try to run it, osx will prompt me to install the JDK.

I wonder if anyone can give an idea on how to use a java command on a Mac without loading a larger JDK?

Many thanks.

+4
source share
1 answer

Have you tried to run this in the terminal?

java -jar MyJarName.jar

jar . Java Mac

EDIT: . cd bin , java packageName.className. , java my.package.Starter.

+5

All Articles