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

q1qsirdb  于 2021-07-12  发布在  Java
关注(0)|答案(1)|浏览(373)

我在netbeans中有一个web项目,当我试图清理和构建它时,这个错误会引发

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

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

应用程序清理和分发日志

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

k97glaaz

k97glaaz1#

ant默认使用的是java1.6jre,它不再适合java11特性。定义一个源和目标版本修复了我使用maven的问题,在这种情况下,maven的行为是相同的。

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

相关问题