adam bien's blog

How To Fix The libs.CopyLibs.classpath Problem in Netbeans 6.5 📎

Recently I encountered the following error running a Java EE project from different Netbeans installation:

Z:\work\workspaces\winery\winery\nbproject\build-impl.xml:137: The following error occurred while executing this line:
Z:\work\workspaces\winery\winery\winery-war\nbproject\build-impl.xml:347: The libs.CopyLibs.classpath property is not set up.
This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at
<netbeans_installation>/java<version>/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
 ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar

I found only few pointers to the problem in the web. You will find a hint in the last line of the error report - you have to add the property libs.CopyLibs.classpath to the ant build.

It can be accomplished in menu: Tools --> Options --> Miscallenous -->  Ant. Put the property  libs.CopyLibs.classpath=[Netbeans Install]\NetBeans6.5\java2\ant\extra\org-netbeans-modules-java-j2seproject-copylibstask.jar (without -D). It should work after that.

I encounter the phenomenon few times. It seems like the error happens after upgrading the libraries (in my case icefaces 1.7.2 to 1.8.0), or running the ant build outside Netbeans in command shell, or continuus integration like hudson.