Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory when execute Enunciate ant task

I received the following stack trace when attempting to use Enunciate to generate documentation for a Java project. I am using JDK 1.8.0_25 and Enunciate 1.30 RC1.

BUILD FAILED
C:\dev\PayWay\make\build.xml:882: java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
        at org.codehaus.enunciate.main.EnunciateTask.execute(EnunciateTask.java:93)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory
        at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
        at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1323)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1076)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 17 more

What is the cause of this problem?

like image 566
WW. Avatar asked Apr 01 '15 23:04

WW.


1 Answers

Enunciate 1.30 RC1 does not support Java 1.8 as it relies on classes which were removed.

This is targeted at Enunciate 2.

See https://github.com/stoicflame/enunciate/issues/68

like image 180
WW. Avatar answered Nov 08 '22 09:11

WW.