我最近升级了我的机器到最新的Java 6版本,在构建项目时一直出现这个错误。请问这是什么意思?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project
biz.minaret: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] javac: invalid target release: 1.6.0_45
[ERROR] Usage: javac <options> <source files>
[ERROR] use -help for a list of possible options
我的pom文件的一部分如下所示
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>1.6.0_45</source>
<target>1.6.0_45</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
我的JAVA_HOME已经正确设置:
PS C:\Users\me\Documents\m
Documents\myproject> java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)>
并且:
Documents\myproject> javac -version
javac 1.6.0_45
javac
的源代码和目标标志,因此接受类似于1.6/6、1.7/7而不是构建号之类的内容。详见http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#options。 - Dave Newton