

If you’re are facing problems with finding JAVA_HOME you might also want to check this article on Stack Overflow: Where is JAVA_HOME on OSX Lion?. I didn’t have that file on my system so I created it with:Įcho JAVA_HOME=`/usr/libexec/java_home -v 1.7` | sudo tee -a /etc/mavenrcįinally Maven was picking up Java 7 both when run from the shell and from eclipse. It turned out that Maven loads settings from /etc/mavenrc if that file exists. Eclipse was started from a shortcut to Eclipse.app rather than a shell so the JAVA_HOME variable was not set. Now I tried to launch mvn from within eclipse but got “ Fatal error compiling: invalid target release: 1.7″. ~/bash_profile but I decided to keep them in ~/.profile and instead load it from ~/.bash_profile using:Īfter fixing the shell initialization files Maven was picking up Java 7 as expected. In January, Apple moved to fend off attacks exploiting those vulnerabilities by adding 'build 19' of Java 7 update 10, denoted by '1.7.010-b19', to its 'ist' blacklist. To use the settings in ~/.profile I could had moved them to. Looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. It turned out that brew had created a ~/.bash_profile file and the bash shell (from the bash man page): The JAVA_HOME environment variable was set in ~/.profile:Įxport MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128M"Įxport JAVA_HOME=`/usr/libexec/java_home -v 1.7`īut it was not exported.
Apple java 7 mac os x#
Oracle Java (Version 7 and later versions) requires an Intel-based Mac running Mac OS X 10.7.3 (Lion) or later and administrator privileges for installation. Java 7 and later versions can run on your Mac. does not provide a download for these systems. If you have problems with Java 6, contact Apple Technical Support.

Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Homeĭefault locale: en_US, platform encoding: MacRoman Java 7 and later versions are not supported by these older versions of Mac OS X. Java version: 1.6.0_41, vendor: Apple Inc. Maven home: /usr/local/Cellar/maven/3.0.4/libexec Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode) Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Both Java 6 and Oracle Java 7 was installed on the system with the default JVM set to Java 7:
Apple java 7 install#
I had a Mac with OS X Mountain Lion (10.8.2) and Maven 3.0.4 (Maven installed using “brew install maven”). Recently I switched to Java 7 and then ran into a couple of issues.
