Issue while compiling in Netbeans: taskdef class CopyLibs cannot be found using the classloader AntClassLoader[]

StackOverflow https://stackoverflow.com/questions/16558066

  •  29-05-2022
  •  | 
  •  

Question

So I've been having issues trying to compile in Netbeans with a program that I've been writing. I've not had this issue until I started to integrate a game engine into what I've been doing, however, it was recently when it started doing this.

The error I am receiving is: taskdef class CopyLibs cannot be found using the classloader AntClassLoader[].

<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
<copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
     <fileset dir="${build.classes.dir}"/>
         <manifest>
              <attribute name="Class-Path" value="${jar.classpath}"/>
              <customize/>
         </manifest>
</copylibs>

I have done nothing to the build xml file. I also don't understand what or why this has even occurred. It also prevents me from being able to build and compile my code to distribute it.

I have done some research within Google, but this doesn't seem to be a famous issue. I have reinstalled Netbeans with a newer version and still get this error. So I'm not sure how to fix this or understand how to fix this.

Any help would be greatly appreciated.

Was it helpful?

Solution

The answer is that a folder was missing from my lib folder.

When setting up my project I had everything set to my lib folder, and when it couldn't find the "CopyLibs" it threw an error stating the jar file was not found.

You can fix this by creating a new project and copying the directory "CopyLibs" to your project and it should fix the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top