I have a jar file that is meant to be ran through the command line.
I am not planning to do any java development on the machines where the application will run and my thought process is that therefore I should only need the JRE and not the JDK. In addition, the JDK is like 4x as big as the JRE and I would like to not have to download it.
When installing the JRE on a Mac, it does not set the path for the java command and if I try to run it, osx prompts me to install the JDK.
I wonder if anyone could provide some insight as to how to use the java command in a mac without having the download the bigger sized JDK?
Thanks a lot.
Have you tried running this in terminal?
java -jar MyJarName.jar
However, you can also try and make a runnable application of the jar file. Take a look at Packaging a Java App for Distribution on a Mac
EDIT:
You can also try running your starter class from the terminal. cd
to the bin folder of your project, then java packageName.className
. For example, java my.package.Starter
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With