首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >错误:选项-Xbootclasspath/p:目标12不允许(Netbeans 11.0)

错误:选项-Xbootclasspath/p:目标12不允许(Netbeans 11.0)
EN

Stack Overflow用户
提问于 2019-05-23 17:40:24
回答 4查看 6K关注 0票数 7

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

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

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

编辑:这是使用选项-Xbootclasspath的部分(build-impl.xml)。这是netbeans生成的脚本。如果完全删除该选项,则编译成功,应用程序似乎可以工作

代码语言:javascript
复制
<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>
EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2019-05-29 17:00:47

我刚刚注意到netbeans 11推荐使用JDK 8,而不是更新的版本。所以我要回到JDK 8..(“问题”已解决)。

票数 0
EN

Stack Overflow用户

发布于 2019-07-31 22:02:32

要在JDK12上编译项目,只需在project.properties文件中将空值设置为endorsed.classpath=

票数 7
EN

Stack Overflow用户

发布于 2019-05-23 18:05:16

JDK9中删除了-Xbootclasspath和-Xbootclasspath/p:(前缀)。您仍然可以使用-Xbootclasspath/a:将内容附加到bootstrap类路径。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56272364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档