英文:
Error when attempting to Clean and Build Java project
问题
最近我将一个Java web应用升级到了Java 11和Tomcat 10。我的集成开发环境是Netbeans 16。
然而,当我尝试在Netbeans中对项目进行清理和构建时,我收到以下错误:
错误:不允许使用 -Xbootclasspath/p 选项与目标 11
以下链接中的解决方案似乎暗示了一个类似的问题,但是答案让我感到困惑。事实上,我甚至不确定它是否与我的问题有关(我不知道如何在Netbeans中添加 sourcepath 命令):
英文:
I recently upgraded a Java web application to use Java 11 and Tomcat 10. My IDE is Netbeans 16.
However when I attempt to Clean and Build the project within Netbeans, I get the following error:
error: option -Xbootclasspath/p: not allowed with target 11
The solution at the following link kind of alludes to a similar problem however Im confused by the answer given. In fact, im not even sure if its related to my problem (Im not sure how to add sourcepath commands in Netbeans):
答案1
得分: 1
我通过将以下内容放置在项目的 'build.xml' 文件中,位于结束项目标签的上方来修复了此问题:
<property name="endorsed.classpath.cmd.line.arg" value="--patch-module java.base='${toString:endorsed.classpath.path}'"/>
此解决方法在以下链接中提供:
https://issues.apache.org/jira/browse/NETBEANS-2452
英文:
I fixed this issue by putting:
<property name="endorsed.classpath.cmd.line.arg" value="--patch-module java.base='${toString:endorsed.classpath.path}'"/>
in the projects 'build.xml' file just above the ending project tag.
This workaround was provided here at the following link:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论