错误:选项 -Xbootclasspath/p:目标 12 不允许(Netbeans 11.0) [英] error: option -Xbootclasspath/p: not allowed with target 12 (Netbeans 11.0)

查看:153
本文介绍了错误:选项 -Xbootclasspath/p:目标 12 不允许(Netbeans 11.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的 IDE 升级到最新版本的 netbeans (11.0) 和 jdk (12.0).当我使用 Ant Project 制作一个简单的基本 Web 应用程序时,我无法编译它,因为输出显示以下错误消息:

I am upgrading my IDE to newest versions of netbeans (11.0) and jdk (12.0). When i make a simple basic Web Application With Ant Project, i can't compile it because the output shows following error message:

错误:选项 -Xbootclasspath/p:目标 12 不允许构建失败(总时间:1 秒)

error: option -Xbootclasspath/p: not allowed with target 12 BUILD FAILED (total time: 1 second)

显然 Ant 脚本使用此选项而 jdk 12 不允许?但是如何解决这个问题??

Obviously Ant script uses this option and jdk 12 does not allow it? But how to fix this??

这是使用选项 -Xbootclasspath 的部分 (build-impl.xml).这是一个netbeans 生成的脚本.如果我完全删除该选项,则编译成功并且应用程序似乎可以运行

this is the section (build-impl.xml) where the option -Xbootclasspath is used. This is a netbeans generated script. If i remove the option completely, compilation succeeds and application seems to work

<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    <condition property="have.tests">
        <or>
            <available file="${test.src.dir}"/>
        </or>
    </condition>
    <condition property="have.sources">
        <or>
            <available file="${src.dir}"/>
        </or>
    </condition>
    <condition property="netbeans.home+have.tests">
        <and>
            <isset property="netbeans.home"/>
            <isset property="have.tests"/>
        </and>
    </condition>
    <condition property="no.javadoc.preview">
        <isfalse value="${javadoc.preview}"/>
    </condition>
    <property name="javac.compilerargs" value=""/>
    <condition property="no.deps">
        <and>
            <istrue value="${no.dependencies}"/>
        </and>
    </condition>
    <condition property="no.dist.ear.dir">
        <not>
            <isset property="dist.ear.dir"/>
        </not>
    </condition>
    <property name="build.web.excludes" value="${build.classes.excludes}"/>
    <condition property="do.compile.jsps">
        <istrue value="${compile.jsps}"/>
    </condition>
    <condition property="do.debug.server">
        <or>
            <not>
                <isset property="debug.server"/>
            </not>
            <istrue value="${debug.server}"/>
            <and>
                <not>
                    <istrue value="${debug.server}"/>
                </not>
                <not>
                    <istrue value="${debug.client}"/>
                </not>
            </and>
        </or>
    </condition>
    <condition property="do.debug.client">
        <istrue value="${debug.client}"/>
    </condition>
    <condition property="do.display.browser">
        <istrue value="${display.browser}"/>
    </condition>
    <condition property="do.display.browser.debug.old">
        <and>
            <isset property="do.display.browser"/>
            <not>
                <isset property="do.debug.client"/>
            </not>
            <not>
                <isset property="browser.context"/>
            </not>
        </and>
    </condition>
    <condition property="do.display.browser.debug">
        <and>
            <isset property="do.display.browser"/>
            <not>
                <isset property="do.debug.client"/>
            </not>
            <isset property="browser.context"/>
        </and>
    </condition>
    <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
    <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
    <condition property="do.war.package.with.custom.manifest">
        <isset property="has.custom.manifest"/>
    </condition>
    <condition property="do.war.package.without.custom.manifest">
        <not>
            <isset property="has.custom.manifest"/>
        </not>
    </condition>
    <condition property="do.tmp.war.package.with.custom.manifest">
        <and>
            <isset property="has.custom.manifest"/>
            <or>
                <isfalse value="${directory.deployment.supported}"/>
                <isset property="dist.ear.dir"/>
            </or>
        </and>
    </condition>
    <condition property="do.tmp.war.package.without.custom.manifest">
        <and>
            <not>
                <isset property="has.custom.manifest"/>
            </not>
            <or>
                <isfalse value="${directory.deployment.supported}"/>
                <isset property="dist.ear.dir"/>
            </or>
        </and>
    </condition>
    <condition property="do.tmp.war.package">
        <or>
            <isfalse value="${directory.deployment.supported}"/>
            <isset property="dist.ear.dir"/>
        </or>
    </condition>
    <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
    <condition else="" property="application.args.param" value="${application.args}">
        <and>
            <isset property="application.args"/>
            <not>
                <equals arg1="${application.args}" arg2="" trim="true"/>
            </not>
        </and>
    </condition>
    <property name="source.encoding" value="${file.encoding}"/>
    <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
        <and>
            <isset property="javadoc.encoding"/>
            <not>
                <equals arg1="${javadoc.encoding}" arg2=""/>
            </not>
        </and>
    </condition>
    <property name="javadoc.encoding.used" value="${source.encoding}"/>
    <property name="includes" value="**"/>
    <property name="excludes" value=""/>
    <property name="runmain.jvmargs" value=""/>
    <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
    <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
        <and>
            <isset property="endorsed.classpath"/>
            <length length="0" string="${endorsed.classpath}" when="greater"/>
        </and>
    </condition>
    <condition else="false" property="jdkBug6558476">
        <and>
            <matches pattern="1\.[56]" string="${java.specification.version}"/>
            <not>
                <os family="unix"/>
            </not>
        </and>
    </condition>
    <property name="javac.fork" value="${jdkBug6558476}"/>
    <condition property="junit.available">
        <or>
            <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
            <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
        </or>
    </condition>
    <condition property="testng.available">
        <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
    </condition>
    <condition property="junit+testng.available">
        <and>
            <istrue value="${junit.available}"/>
            <istrue value="${testng.available}"/>
        </and>
    </condition>
    <condition else="testng" property="testng.mode" value="mixed">
        <istrue value="${junit+testng.available}"/>
    </condition>
    <condition else="" property="testng.debug.mode" value="-mixed">
        <istrue value="${junit+testng.available}"/>
    </condition>
</target>

推荐答案

我刚刚注意到 netbeans 11 建议使用 JDK 8 而不是更新的版本.所以我要回到 JDK 8..(问题"解决了).

I just noticed that netbeans 11 recommends using JDK 8 with it instead of newer versions. So i'm going back to JDK 8.. ("problem" solved).

这篇关于错误:选项 -Xbootclasspath/p:目标 12 不允许(Netbeans 11.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆