NetBeans – include external libraries

http://www.coderanch.com/t/419419/vc/there-way-netbeans-include-external

Put something like this at the bottom of build.xml, just before “</project>”:

<target name="-post-jar">
  <jar jarfile="${dist.jar}" update="true">
    <zipfileset src="${dist.jar}" includes="**/*.class" />
    <zipfileset src="${reference.mylib.jar}" includes="**/*.class"/>
  </jar>
</target>

You have to change reference.mylib.jar above to match the name of your library. If you have added your libraries to the project with the “Add Project” button in the “Libraries” section of the “Project Properties” dialog, your project.properties file will contain lines like the following for each included library project:

reference.mylib.jar=${project.mylib}/dist/mylib.jar

The part before “=” is the string you should use in the src attribute of the zipfileset element.

If you have more than one library, add a zipfileset element for each of them.