我有一个使用java 8在netbeans中开发的项目。现在,我迁移到Java 9,并且我正在使用netbeans的开发版本。当我使用java 8平台构建项目时,一切正常,/dist/lib目录是用jar和项目主jar文件一起创建的,但当我使用java 9平台时,只创建了项目主jar,而没有创建/dist/lib。构建成功了,我可以在IDE中运行项目,问题是当我运行项目jar时,它缺少了应该在/dist/lib中的库jar。
发布于 2018-08-03 18:57:10
我认为这是NetBeans中的一个错误。在https://issues.apache.org/jira/browse/NETBEANS-1097中报告
同时,您可以通过手动编辑nbproject\build-impl.xml来修复它。查找此部分:
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
<not>
<istrue value="${modules.supported.internal}"/>
</not>
</and>
</condition>并删除此部分:
<not>
<istrue value="${modules.supported.internal}"/>
</not>因此这一点仍然存在:
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
</and>
</condition>然后它就会按预期工作--直到NetBeans重新创建build-impl.xml...
发布于 2019-04-27 00:47:22
使用nb10.dist/lib不会构建在新项目上。上面的修复是有效的,但我首先必须创建dist/lib。
https://stackoverflow.com/questions/45347003
复制相似问题