您好,我正在尝试为作业建立一个项目,而且我在这里收到错误
H:\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:993: The following error occurred while executing this line:
H:\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:837: copylibs doesn't support the "excludeFromCopy" attribute
我还没有找到解决这个问题的方法,并且想知道这可能是什么导致这就是整个输出
ant -f H:\\NetBeansProjects\\JavaApplication3 clean jar`
init:
deps-clean:
Updating property file: H:\NetBeansProjects\JavaApplication3\build\built-clean.properties
Deleting directory H:\NetBeansProjects\JavaApplication3\build
clean:
init:
deps-jar:
Created dir: H:\NetBeansProjects\JavaApplication3\build
Updating property file: H:\NetBeansProjects\JavaApplication3\build\built-jar.properties
Created dir: H:\NetBeansProjects\JavaApplication3\build\classes
Created dir: H:\NetBeansProjects\JavaApplication3\build\empty
Created dir: H:\NetBeansProjects\JavaApplication3\build\generated-sources\ap-source-output
Compiling 2 source files to H:\NetBeansProjects\JavaApplication3\build\classes
compile:
Created dir: H:\NetBeansProjects\JavaApplication3\dist
Copying 1 file to H:\NetBeansProjects\JavaApplication3\build
H:\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:993: The following error occurred while executing this line:
H:\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:837: copylibs doesn't support the "excludeFromCopy" attribute
BUILD FAILED (total time: 1 second)
答案 0 :(得分:3)
检查答案:https://netbeans.org/bugzilla/show_bug.cgi?id=231468
我找到了解决这个问题的方法,但我仍然不知道为什么会这样。您必须转到build-impl.xml并在第829行上删除设置为excludeFromCopy的设置。这将允许您成功编译代码。生成的文件也是可运行且准确的。
答案 1 :(得分:1)
解决方案1: 安装更高版本的NetBeans。或者
解决方案2: 如果您不想安装更高版本的NetBeans,请进行以下更改以使代码编译
-打开\ nbproject \ build-impl.xml
-查找包含的行
-从上述各行中删除excludeFromCopy
属性(而不是整个行,而只是该属性),现在您的代码应该可以编译了。
答案 2 :(得分:0)
在我的impl.xml中,它的第843行(Project / nbproject / impl.xml)
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
更改以下给定的上述行(删除[excludeFromCopy =“$ {copylibs.excludes}”]部分)
<copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">