I am trying to build an existing maven project on a fresh install of the latest netbeans but am getting the following error, any help is much appreciated:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project com.rory.ngp.test: Compilation failure
Failure executing javac, but could not parse the error:
javac: invalid target release: 1.7
I think it has something to do with paths but am not sure exactly. Here is the contents of my /usr/lib/jvm directory;
bash-4.1$ pwd
/usr/lib/jvm
bash-4.1$ ls
java java-openjdk jre-1.6.0-openjdk.x86_64
java-1.5.0-gcj-1.5.0.0 jre jre-gcj
java-1.6.0 jre-1.5.0 jre-openjdk
java-1.6.0-openjdk-1.6.0.0.x86_64 jre-1.5.0-gcj
java-1.6.0-openjdk.x86_64 jre-1.6.0
1. Fix invalid target release error by changing project's Java version. Then run mvn package again, the invalid target release error will be gone.
The problem is that there is mismatch in the Java/JDK versions. The project is trying to use a particular Java version to build the project. However, the system doesn't support the Java version the project is intended to build upon. First things first, decide on which Java/JDK version you want to use.
Thanks oers, you were right.
I needed to install JDK 1.7/Java 7, and then edit the netbeans config file in the netbeans install directory /etc/netbeans.conf to point to where I installed the new version of Java:
# Default location of JDK, can be overridden by using --jdkhome <dir>:
netbeans_jdkhome="/users/rory/Documents/jdk1.7.0_02"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With