Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans with Java 9 not creating /dis/lib

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.

like image 277
m.y.m Avatar asked Jul 27 '17 09:07

m.y.m


1 Answers

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...

like image 119
Joonas Pulakka Avatar answered Nov 15 '22 05:11

Joonas Pulakka