java - Maven test error: javac: source release 1.8 requires target release 1.8 -
if run mvn -e test
, error:
[info] error stacktraces turned on. [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building skat09 0.0.1-snapshot [info] ------------------------------------------------------------------------ [warning] artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated commons-io:commons-io:jar:1.3.2 [info] [info] --- maven-resources-plugin:2.6:resources (default-resources) @ skat09 --- [info] using 'utf-8' encoding copy filtered resources. [info] copying 6 resources [info] copying 191 resources [info] [info] --- maven-compiler-plugin:3.3:compile (default-compile) @ skat09 --- [info] changes detected - recompiling module! [info] compiling 64 source files /home/buzz-dee/workspace/skat09/target/classes [info] ------------------------------------------------------------- [error] compilation error : [info] ------------------------------------------------------------- [error] javac: source release 1.8 requires target release 1.8 [info] 1 error [info] ------------------------------------------------------------- [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 0.729 s [info] finished at: 2015-10-02t23:17:02+02:00 [info] final memory: 10m/298m [info] ------------------------------------------------------------------------ [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project skat09: compilation failure [error] javac: source release 1.8 requires target release 1.8 [error] -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project skat09: compilation failure javac: source release 1.8 requires target release 1.8 @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:212) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:116) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:80) @ org.apache.maven.lifecycle.internal.builder.singlethreaded.singlethreadedbuilder.build(singlethreadedbuilder.java:51) @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:128) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:307) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:193) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:106) @ org.apache.maven.cli.mavencli.execute(mavencli.java:862) @ org.apache.maven.cli.mavencli.domain(mavencli.java:286) @ org.apache.maven.cli.mavencli.main(mavencli.java:197) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:289) @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:229) @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:415) @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:356) caused by: org.apache.maven.plugin.compiler.compilationfailureexception: compilation failure javac: source release 1.8 requires target release 1.8 @ org.apache.maven.plugin.compiler.abstractcompilermojo.execute(abstractcompilermojo.java:911) @ org.apache.maven.plugin.compiler.compilermojo.execute(compilermojo.java:129) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:134) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:208) ... 20 more [error] [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojofailureexception
this maven pom.xml
:
<plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.3</version> <configuration> <rules> <requirejavaversion> <version>1.8</version> </requirejavaversion> </rules> <source>1.8</source> <tagret>1.8</tagret> </configuration> </plugin> </plugins>
the output mvn -version
:
apache maven 3.3.3 (non-canonical_2015-07-27t12:38:38_root; 2015-07-27t11:38:38+02:00) maven home: /opt/maven java version: 1.8.0_60, vendor: oracle corporation java home: /usr/lib/jvm/java-8-jdk/jre default locale: de_de, platform encoding: utf-8 os name: "linux", version: "4.2.2-1-arch", arch: "amd64", family: "unix"
java jdk (archlinux-java get
) setting:
java-8-jdk
java compiler version (javac -version
):
javac 1.8.0_60
i tried add:
<verbose>true</verbose> <fork>true</fork> <executable>/usr/lib/jvm/java-8-jdk/bin/javac</executable> <compilerversion>1.8</compilerversion>
to configuration
element of maven-compiler-plugin
in pom.
what problem above error , how can solve it?
you made typo: <tagret>1.8</tagret>
should <target>1.8</target>
Comments
Post a Comment