Wednesday, July 17, 2013

How to get rid of "The libs.CopyLibs.classpath property is not set up" ... error message in NetBeans

Recently I tried to build a Java project using ant command, I received the infamous CopyLibs BUILD-FAIL message.

 $ ant

/opt/tomcat-sbillah/webapps/graph2/nbproject/build-impl.xml:786: 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
/java/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



To fix this issue I used below steps.

  1. Find "private.properties" file from "nbproject/private/private.properties" location in your project folder.
  2. Comment (#) "user.properties.file" attribute in private.properties file. It is pointing to a local file location (This is the root cause)
  3. Find project.properties file from your source location. Add following attributes to the file.
 libs.CopyLibs.classpath=
 libs.CopyLibs.javadoc=
 libs.CopyLibs.maven-pom=
 libs.CopyLibs.src=


 4. Download "org-netbeans-modules-java-j2seproject-copylibstask.jar" file from www.java2s.com/Code/JarDownload/org-netbeans-modules-java/org-netbeans-modules-java-j2seproject-copylibstask.jar.zip
  
 5. Save this Jar file to a folder (extras). Set its path to "libs.CopyLibs.src" attribute.
ex:   
libs.CopyLibs.src=C:/Deployer/java/dist/svn/vcelerity81/12009939/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar

6. Done !!

Reference : 

http://sbillah.blogspot.sg/2013/03/how-to-get-rid-of-libscopylibsclasspath.html
 

No comments: