Deploy java app to open with JRE

112 views Asked by At

I wrote a Java app that I exported as an executable .jar. When I run it on a mac, though, it says "java -jar app.jar is a command-line tool" and that the user has to install the JDK.

I know that since it's a jar, the user will have to have Java installed to run it, but is there a way to compile (as a .jar) it so that it can be opened with just the JRE or whatever comes pre-installed on mac? Or do I have to package it somehow for the OS?

1

There are 1 answers

0
Madhan On

When I try to use java from the command line, why doesn't it work?
I have Oracle's version of the JRE installed.

Installing a JRE from Oracle does not update java -version symlinks or add java to your path. For this functionality, you must install the full JDK. See Mac command line info.