java.lang.NoClassDefFoundError:com / sun / mirror / apt / AnnotationProcessorFactory执行时执行Enunciate ant任务

时间:2015-04-01 23:52:10

标签: java-8 enunciate

尝试使用Enunciate生成Java项目的文档时,我收到了以下堆栈跟踪。我使用的是JDK 1.8.0_25和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

这个问题的原因是什么?

1 个答案:

答案 0 :(得分:6)

Enunciate 1.30 RC1不支持Java 1.8,因为它依赖于被删除的类。

这是针对Enunciate 2。

请参阅https://github.com/stoicflame/enunciate/issues/68