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 due to a 25 error.
I updated JAVA_HOME :
:~ > echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
java and javac reporting the correct version:
:~ > java -version java 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 -version javac 1.8.0_25
libexec correct:
:~ > /usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
The currentJDK symbolic link is correct:
:~ > ls -la /System/Library/Frameworks/JavaVM.framework/Versions/ total 64 drwxr-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@ -> CurrentJDK lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.4.2@ -> CurrentJDK lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.5@ -> CurrentJDK lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.5.0@ -> CurrentJDK lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.6@ -> CurrentJDK lrwxr-xr-x 1 root wheel 10B Jul 28 14:50 1.6.0@ -> CurrentJDK drwxr-xr-x 8 root wheel 272B Jul 29 18:41 A/ lrwxr-xr-x 1 root wheel 1B Jul 28 14:50 Current@ -> A lrwxr-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 -version Error: JAVA_HOME is not defined correctly. We cannot execute /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java
Launch OSX Mavericks.
Any idea why Maven is ignoring JAVA_HOME ?
java maven macos
Stormehawke
source share