1 2 Previous Next 17 Replies Latest reply: Feb 12, 2013 10:26 AM by 987437 RSS

    NoClassDefFoundError when I run a custom doclet from command line

    987437
      I have a custom Doclet created - SimpleDoclet. I have compiled this file and I have the class and java files in the same dir (oldPack)

      When I run this from oldPack directory (where the class and java files are present) :
      javadoc -doclet SimpleDoclet -docletpath . -classpath /usr/java/jdk1.6.0_30/lib/tools.jar SimpleDoclet.java

      I get the following error:
      java.lang.NoClassDefFoundError: SimpleDoclet (wrong name: oldPack/SimpleDoclet)
           at java.lang.ClassLoader.defineClass1(Native Method)
           at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
           at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
           at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
           at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
           at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
           at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
           at com.sun.tools.javadoc.DocletInvoker.<init>(DocletInvoker.java:74)
           at com.sun.tools.javadoc.Start.setDocletInvoker(Start.java:380)
           at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:179)
           at com.sun.tools.javadoc.Start.begin(Start.java:128)
           at com.sun.tools.javadoc.Main.execute(Main.java:41)
           at com.sun.tools.javadoc.Main.main(Main.java:31)
      javadoc: error - fatal error
      1 error

      Tried this with another custom doclet and still gives this error. Any solutions please?
        1 2 Previous Next