How to use maven3 with java7 on OSX Mavericks? <p>I installed maven3 on Mavericks by Macports. It's working well but using java 1.6. How could I change to use java 7 instead?</p> <h3>Maven3 is installed but using java 1.6:</h3> <pre><code>$ mvn -version Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 13:51:28+0000) Maven home: /opt/local/share/java/maven3 Java version: 1.6.0_65, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac" </code></pre> <h3>Java 7 is also installed:</h3> <pre><code>$ java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) </code></pre> <h3>Java 7 path:</h3> <pre><code>$ which java /usr/bin/java $ ls -lah /usr/bin/java lrwxr-xr-x 1 root wheel 74B 26 Oct 13:33 /usr/bin/java -&gt; /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java </code></pre> <p>What's the difference in the two java paths?</p> <ul> <li>/System/Library/Java/JavaVirtualMachines</li> <li>/System/Library/Frameworks/JavaVM.framework/Versions</li> </ul>