For some reason Maven is ignoring JAVA_HOME on OSX.
I recently upgraded from java 8 build 11 to java 8 build 25 and removed 11 because of a bug fix in 25.
I have updated JAVA_HOME
:
:~ > echo $JAVA_HOME/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
java
and javac
both report the correct version:
:~ > java -versionjava version "1.8.0_25"Java(TM) SE Runtime Environment (build 1.8.0_25-b17)Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode):~ > javac -versionjavac 1.8.0_25
libexec
is correct:
:~ > /usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
the CurrentJDK symlink is correct:
:~ > ls -la /System/Library/Frameworks/JavaVM.framework/Versions/total 64drwxr-xr-x 11 root wheel 374B Nov 19 14:35 ./drwxr-xr-x 12 root wheel 408B Sep 23 14:29 ../lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.4@ -> CurrentJDKlrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.4.2@ -> CurrentJDKlrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.5@ -> CurrentJDKlrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.5.0@ -> CurrentJDKlrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.6@ -> CurrentJDKlrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.6.0@ -> CurrentJDKdrwxr-xr-x 8 root wheel 272B Jul 29 18:41 A/lrwxr-xr-x 1 root wheel 1B Jul 28 14:50 Current@ -> Alrwxr-xr-x 1 root wheel 58B Nov 19 14:35 CurrentJDK@ -> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents
But Maven is still trying to hit 1.8.0_11:
:~ > mvn -versionError: JAVA_HOME is not defined correctly. We cannot execute /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java
Running OSX Mavericks.
Any idea why Maven is ignoring JAVA_HOME
?