迁移到Java 11
时遇到此错误。
这些是我的设置:
[INFO] Encoding: UTF-8
[INFO] Compiler source level: 11
[INFO] Compiler target level: 1.8
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project *: Fatal error compiling: Failed to run the ecj compiler: source level should be comprised in between '1.3' and '1.9' (or '5', '5.0', ..., '9' or '9.0'): 11 -> [Help 1]
我已经检查了“偏好设置”->“ Java编译器”,并将其更改为1.8,但无济于事。
谢谢
答案 0 :(得分:0)
您可以将maven中使用的Java版本配置为JDK / 11以下的任何版本,并使用maven-compiler-plugin:3.8.0来指定9、10、11的发行版,而无需任何显式依赖。 / p>
matrix[2] = new int[12]{1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1};