$JAVA_HOME without JDK

I try to run a jar file on my user laptop and found that the terminal java version is different from the 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.

  1. Go to System Preference > Java

2. Check or update your java version on Update tab

3. On Java tab, click button View to see the java installation location.

4. Copy the path and remove bin/java

5. Setup environment variable on your mac

6. Check your java version

Previously published in https://imantung.github.io at 13 Sep 2017