I have a project that is developed in netbeans using java 8. Now, I migrated to Java 9 and I am using a development version of netbeans. When I build the project using java 8 platform everything is OK and /dist/lib directory is created with the jars along with the project main jar file, but when I use java 9 platform only the project main jar is created and /dist/lib is not created. The build is successful and I can run the project in the IDE the problem is that when I run the project jar it's missing the library jars which are supposed to be in /dist/lib.
I think this is a bug in NetBeans. Reported in https://issues.apache.org/jira/browse/NETBEANS-1097
Meanwhile, you can fix it by editing nbproject\build-impl.xml by hand. Find this part:
<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>
and delete this part:
<not>
<istrue value="${modules.supported.internal}"/>
</not>
so that this remains:
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
</and>
</condition>
Then it works as expected - until NetBeans recreates build-impl.xml...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With