清理和构建Java项目时出现错误。

huangapple go评论64阅读模式
英文:

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):

https://stackoverflow.com/questions/53106749/javadoc-error-option-boot-class-path-not-allowed-with-target-11

答案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:

https://issues.apache.org/jira/browse/NETBEANS-2452

huangapple
  • 本文由 发表于 2023年6月8日 06:30:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76427483.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定