Make sure that your environment (PATH) is set up to use the JDK version that you want to use for compiling. You can check this by running the following in the shell or command window where you want to run Maven:
java -version
javac -version
Make sure that both java
and javac
are pointing to the correct version. It's possible that you have a 1.7 JRE (which does not include the compiler) and a 1.6 JDK (which includes the compiler) and the wrong one is being used.
If necessary, adjust your JAVA_HOME
and PATH
environment variables.
Just noticed that you're on CentOS - it's possible that java
and javac
point to different versions. Use the alternatives
command to check that, see here for an example: http://wiki.centos.org/HowTos/JavaRuntimeEnvironment - you will have to check both the java
and the javac
command.