Looking for: “java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener”

When trying to put together a jar file on Ubuntu Lucid with gant, I got this:

java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getMethod0(Class.java:2670)
        at java.lang.Class.getMethod(Class.java:1603)
        at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java                  :99)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildListener
        at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 6 more

After also installing the ant package everything worked fine…

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.