Java is an optional package on the latest versions of macOS.
Yet once installed it appears like the JAVA_HOME environment variable is not set properly.
Java is an optional package on the latest versions of macOS.
Yet once installed it appears like the JAVA_HOME environment variable is not set properly.
I Had to explicitly set it to the exact path on my Macbook air .
Steps followed:
I am running MACOS MOJAVE - 10.14.2 (18C54) on a Macbook Air with JAVA 8
Anyone using AUSKEY from the Australian Tax Office (ATO) should uninstall AUSKEY. This sorted out my JAVA_HOME issues.
It is also no longer required for MAC users. Yah!
For Mac Yosemite,
JDK 1.7.0_xx is using
Got the same issue after I upgrade my Mac OS and following worked for me:
cmd>vi ~/.bash_profile
Add/update the line for JAVA_HOME: export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home"
cmd>source ~/.bash_profile or open a new terminal
I think the jdk version might differ, so just use the version which you have under /Library/Java/JavaVirtualMachines/
For me, Mountain Lion 10.8.2, the solution most voted does not work. I installed jdk 1.7 via Oracle and maven from homebrew.
My solution is from the hadoop-env.sh file of hadoop which I installed from homebrew, too. I add the below sentence in ~/.bash_profile, and it works.
This solution also works for OS X Yosemite with Java 1.8 installed from Oracle.
The following worked for me. I'm using ZSH on OSX Yosemite with Java 8 installed.
The following command
/usr/libexec/java_home
emits the path to JDK home:/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
In your
~/.zshrc
,