I am testing my current application with Mac OS X which has Java 7 from Oracle installed. Instead using Java 7 from Oracle, it\'s using Java 6 from Apple. The default system
EDIT: Uwe's impressive answer is absolutely correct for the OP who it turns out was using the AppLauncher. My initial read of the question was that it related to command-line issues on OSX with Java 6 vs Java 7. The comments on the original question show I was wrong. However, anyone having command-line issues may find the below a simpler solution.
ORIGINAL:
My circumstances seemed the same as I thought the OP had: Java 1.7 perfectly on the command-line but mvn failing and complaining about 1.6, general compilation had been working fine using sbt and IntelliJ. I only started having problems compiling a third-party project with mvn.
I found this to work well and be much simpler:
http://www.jayway.com/2013/03/08/configuring-maven-to-use-java-7-on-mac-os-x/
All I needed from that was the following in .profile:
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
Set that variable and mvn worked well.