On my machine I have two Java versions installed: (1.6 and 1.7 installed manually by me). I need both of them for different projects. But for Maven I need 1.7, but my Maven uses the 1.6 Java version.
How can I set Maven to use 1.7?
Maven uses the JAVA_HOME
parameter to find which Java version it is supposed to run. I see from your comment that you can't change that in the configuration.
JAVA_HOME
parameter just before you start maven (and change it back afterwards if need be). mvn
(non-windows)/mvn.bat
/mvn.cmd
(windows) and set your java version explicitly there.