我有一个使用java 8在netbeans中开发的项目。现在,我迁移到Java 9,我正在使用netbeans的开发版本。当我使用java 8平台构建项目时,一切正常,并且使用jar和项目主jar文件创建/ dist / lib目录,但是当我使用java 9平台时,只创建了项目主jar和/ dist / lib没有创建。构建是成功的,我可以在IDE中运行项目,问题是,当我运行项目jar时,它缺少应该在/ dist / lib中的库jar。
我认为这是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 ...
使用NB 10. dist / lib不会建立在新项目上。上面的修复工作,但我首先要创建dist / lib。