Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Netbeans ant构建错误';不支持的元素自定义';_Java_Netbeans_Ant - Fatal编程技术网

Java Netbeans ant构建错误';不支持的元素自定义';

Java Netbeans ant构建错误';不支持的元素自定义';,java,netbeans,ant,Java,Netbeans,Ant,我从7.0.1更新到了Netbeans 8.0.1,如果禁用了“Web Start”,我的java程序可以很好地编译。一旦启用“Web Start”,我就会出现以下错误: C:\NetBeansProjects\SearchCriteriaEditor\nbproject\jnlp-impl.xml:480: unsupported element customize 在jnlp-impl.xml文件的本节中: 要在不使用Ant的情况下从命令行运行此应用程序,请尝试: javaws“${

我从7.0.1更新到了Netbeans 8.0.1,如果禁用了“Web Start”,我的java程序可以很好地编译。一旦启用“Web Start”,我就会出现以下错误:

C:\NetBeansProjects\SearchCriteriaEditor\nbproject\jnlp-impl.xml:480: 
unsupported element customize
  • 在jnlp-impl.xml文件的本节中:

    
    要在不使用Ant的情况下从命令行运行此应用程序,请尝试:
    javaws“${jnlp.file.resolved}”
    

据我所知,修复方法是:“将以下内容添加到自定义junit宏定义中:”

<attribute default="" name="testmethods"/>
   <element name="customize" optional="true"/>
<customize/>

问题是我不知道它在哪里,也没有以任何方式修改我的ant文件……有人能给我更多的信息吗?我假设修复程序位于jnlp-impl.xml文件的某个地方;我只是不知道该把它放在哪里

编辑更新:在jnlp-impl.xml文件中添加了所有引用“copylibs”的部分-

<target name="-test-jnlp-type" depends="-test-jnlp-enabled" if="is.jnlp.enabled">
    <condition property="is.applet">
        <equals arg1="${jnlp.descriptor}" arg2="applet" trim="true"/>
    </condition>
    <condition property="is.application">
        <equals arg1="${jnlp.descriptor}" arg2="application" trim="true"/>
    </condition>
    <condition property="is.component">
        <equals arg1="${jnlp.descriptor}" arg2="component" trim="true"/>
    </condition>
    <condition property="is.applet+mkdist.available">
        <and>
            <isset property="libs.CopyLibs.classpath"/>
            <istrue value="${is.applet}"/>
        </and>
    </condition>
    <condition property="is.application+mkdist.available">
        <and>
            <isset property="libs.CopyLibs.classpath"/>
            <istrue value="${is.application}"/>
        </and>
    </condition>
    <condition property="is.component+mkdist.available">
        <and>
            <isset property="libs.CopyLibs.classpath"/>
            <istrue value="${is.component}"/>
        </and>
    </condition>
</target>

......

<target name="-do-jar-jnlp-application" depends="-init-filename,-test-jnlp-type,-init-macrodef-copylibs" if="is.application+mkdist.available">
    <j2seproject3:copylibs manifest="${tmp.manifest.file}">
        <customize>
            <attribute name="Main-Class" value="${main.class}"/>
        </customize>
    </j2seproject3:copylibs>
    <echo>To run this application from the command line without Ant, try:</echo>
    <property location="${jnlp.dest.dir}/${jnlp.file}" name="jnlp.file.resolved"/>
    <echo>javaws "${jnlp.file.resolved}"</echo>
</target>
<target name="-do-jar-jnlp-component" depends="-test-jnlp-type,-init-macrodef-copylibs" if="is.component+mkdist.available">
    <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
</target>

......
要在不使用Ant的情况下从命令行运行此应用程序,请尝试:
javaws“${jnlp.file.resolved}”

提前谢谢。

你好,马努蒂,很抱歉让你很痛苦。。CopyLib没有宏定义。我已将nlp-impl.xml中对copylibs的所有引用添加到原始问题中。我需要将其添加到文件中吗?@Robbie62肯定有
copylibs
的定义。它可能位于由
jnlp impl.xml
导入的另一个Ant构建文件中吗?嗨,manouti,是的,我完全忘记了另一个构建文件。我现在正在做一个谷歌创业挑战赛,所以我要过几天才能重新开始。在这件事上工作了四年之后,我想可能是精疲力竭开始了。全局搜索和替换的经典案例,替换不应该替换的东西。澳大利亚人将customize拼写为“customize”,所以当我重新启用webstart时,它使用了一个带有“customize”的条目,它找不到原始定义,因为glbal搜索已经更改了它。谢谢你,manouti,至少你让我找到了正确的位置……我非常感激。
<macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
<macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
    ... <!-- some attributes may be defined here first -->
    <element name="customize" optional="true"/>  <!-- customize should be defined here -->
    <sequential>
        ...
        <!-- somewhere in the macrodef -->
        <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
            <fileset dir="${build.classes.dir}"/>
            <manifest>
                <attribute name="Class-Path" value="${jar.classpath}"/>
                <customize/>    <!-- this is where customize is used -->  
            </manifest>
         </copylibs>
         ...
    </sequential>
</macrodef>