Wednesday, February 20, 2013

netbeans re-create build-impl.xml

netbeans - return the 'Libraries Folder' text box to its default state

in a netbeans java project -> properties -> library, there is a field called "libraries folder".  i selected a value for it and realized that i didn't need it.  i saw no way to remove it.  to remove it, find the file project.xml under the nbproject folder and remove this:

<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
            <definitions></definitions>
</libraries>

this creates a problem if you try to build your project.  the error is something like:

..\nbproject\build-impl.xml:63: Source resource does not exist: ..\nblibraries.properties

basically build-impl.xml is looking for the nblibraries property you had specified earlier.  the way to fix this is to delete and re-create the build-iml.xml

delete / remove build-impl.xml   close your project and then re-open your project.  the file will be re-created.

netbeans java project add lib jar/folder

i created a netbeans standard java project.  i wanted to add a folder which had the jars (such as spring.jar, etc.) to the project.  right click on project name -> properties -> libraries menu.   right hand side add jar/folder option.  you can select the folder and add it.   However, this does not work correctly.  Adding the ENTIRE FOLDER does not work.  It creates a default package and puts the jars below it and your source classes cannot see them.  You have to go inside the folder you want to include and select all the jars you want included.  Then they are displayed correctly and you can expand them in the libraries tab.