微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在 netbeans 中清理和构建 Web 应用程序

如何解决无法在 netbeans 中清理和构建 Web 应用程序

当我尝试清理和构建它时,我在 netbeans 中有一个 Web 项目,此错误引发

error: option -Xbootclasspath/p: not allowed with target 11

交叉检查所有依赖项,包括所有 jar 文件。但是项目可以在 tomcat 中部署(我怀疑正在部署旧版本的战争)有人可以帮忙吗?

应用程序清理和分发日志

    ant -f /xx/xx/app -Dnb.internal.action.name=rebuild -DforceRedeploy=false -Dbrowser.context=/xx/xx/app clean dist
    init:
    undeploy-clean:
    deps-clean:
    galeva_base.init:
    galeva_base.deps-clean:
    Updating property file: /xx/xx/base_project/build/built-clean.properties
    Deleting directory /xx/xx/base_project/build
    base_project.clean:
    do-clean:
    Deleting directory /xx/xx/app/build
    check-clean:
    clean:
    init:
    deps-module-jar:
    base_project.init:
    base_project.deps-jar:
    Created dir: /xx/xx/base_project/build
    Updating property file: /xx/xx/base_project/build/built-jar.properties
    Created dir: /xx/xx/base_project/build/classes
    Created dir: /xx/xx/base_project/build/empty
    Created dir: /xx/xx/base_project/build/generated-sources/ap-source-output
    Compiling 40 source files to /xx/xx/base_project/build/classes
    base_project.compile:
    Created dir: /xx/xx/base_project/dist
    copying 1 file to /xx/xx/base_project/build
    copy libraries to /xx/xx/base_project/dist/lib.
    Building jar: /xx/xx/base_project/dist/base_project.jar
    To run this application from the command line without Ant,try:
    java -jar "/xx/xx/base_project/dist/base_project.jar"
   base_project.deploy:
    base_project.jar:
    deps-ear-jar:
    deps-jar:
    Created dir: /xx/xx/app/build/web/WEB-INF/classes
    Created dir: /xx/xx/app/build/web/meta-inf
    copying 1 file to /xx/xx/app/build/web/meta-inf
    copying 3 files to /xx/xx/app/build/web
    library-inclusion-in-archive:
    copying 1 file to /xx/xx/app/build/web/WEB-INF/lib
    copying 1 file to /xx/xx/app/build/web/WEB-INF/lib
    library-inclusion-in-manifest:
    Created dir: /xx/xx/app/build/empty
    Created dir: /xx/xx/app/build/generated-sources/ap-source-output
    Compiling 17 source files to /xx/xx/app/build/web/WEB-INF/classes
    error: option -Xbootclasspath/p: not allowed with target 11
    BUILD Failed (total time: 5 seconds)

openjdk 版本

jdk 11

Netbeans 版本

12.3

Tomcat 版本

雄猫 10

解决方法

ANT 默认使用 Java 1.6 JRE,这不再适合 Java 11 功能。 使用 maven 定义源和目标版本为我修复了它,在这种情况下它的行为方式相同。

<property name="ant.build.javac.source" value="11"/>
<property name="ant.build.javac.target" value="11"/>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?