java版本:17.0.6
蚂蚁版本:1.10.12
Ubuntu 22.04.4 LTS
Netbeans 的构建失败并显示以下消息:
-do-compile:
[nb-javac] Compiling 10 source files to /media/meca1/GITHUB-NETBEANS/netbeans/platform/api.dashboard/build/classes
[nb-javac] Ignoring source, target and bootclasspath as release has been set
[repeat] error: release version 17 not supported
[repeat] Usage: javac <options> <source files>
[repeat] use --help for a list of possible options
[nbmerge] Failed to build target: all-api.dashboard
BUILD FAILED
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:635: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:630: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:665: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:648: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:630: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/build.xml:677: The following error occurred while executing this line:
/media/meca1/GITHUB-NETBEANS/netbeans/nbbuild/templates/common.xml:208: Compile failed; see the compiler error output for details
第一次尝试是使用 java jdk 17。 尝试将 java 版本更改为较旧的版本。 即使 netbeans 文档说 17 也可以。
export JAVA_HOME=/opt/jdk-11
问题是一样的。
设置 JAVA_HOME 变量是不够的。 PATH环境变量也必须指向jdk 17。
修复此问题后编译成功。