13 Sep 2017
$JAVA_HOME without JDK
I try run some jar file on my user laptop and found that terminal java version is different with mac OS version. Downloading JRE is not helping because it’s not set environment variable $JAVA_HOME
This instruction may help to set $JAVA_HOME
without downloading JDK.
- Go to
System Preference > Java
- Check or update your java version on
Update
tab -
On
Java
tab, click buttonView
to see java installation location. - Copy the
path
and removebin/java
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
- Setup environment variable on your mac
$ echo "export JAVA_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" >> ~/.bash_profile $ source .bash_profile
- Check your java version
$ java -version