When I run \"clean and build\" the .jar file that is being created only runs if the lib folder is at the same folder of the .jar file.
.jar
lib
You can also use this (when the libraries are not in "dist/lib"), tested with NetBeans and ant-contrib: