Maven compiler error for invalid target java
Maven compiler error for invalid target java
Some time you may see following error during maven compilation
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile) on project metamarket: Fatal error compiling: invalid target release: 1.8 or 1.7 or 1.6 -> [Help 1]
This error is because, you system is set to use different version as default and source and target configuration is also set accordingly.
example -> You configuration in pom says to use default at 1.7 and you are tying to compile the code with java 1.8
You may need to add the right version in source and target to fix this. Here is the entry for pom.xml
<build>Please change the source and target version according to your setup and need depending on your configuration.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Comments
Post a Comment