使用Java 11与Netbeans 11进行编译时出现NoClassDefFoundError

时间:2019-06-25 03:29:58

标签: java netbeans java-11 javahelp netbeans-11

我正在工作的Java项目当前使用@HelpSetRegistration,在Open jdk8和netbeans 8上运行良好。

但是当我将项目更改为Netbeans 11和openjdk 11时,出现编译错误

注释处理器引发了一个未捕获的异常。 有关详细信息,请查阅以下堆栈跟踪。 java.lang.NoClassDefFoundError:com / sun / java / help / search / Indexer

请提出解决方法。附有完整的构建错误日志

注释处理器引发了一个未捕获的异常。 有关详细信息,请查阅以下堆栈跟踪。

java.lang.NoClassDefFoundError: com/sun/java/help/search/Indexer
    at org.netbeans.modules.javahelp.HelpSetRegistrationProcessor.handleProcess(HelpSetRegistrationProcessor.java:145)
    at org.openide.filesystems.annotations.LayerGeneratingProcessor.process(LayerGeneratingProcessor.java:99)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:972)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:888)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1214)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1326)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
    at com.sun.tools.javac.main.Main.compile(Main.java:311)
    at com.sun.tools.javac.main.Main.compile(Main.java:170)
    at com.sun.tools.javac.Main.compile(Main.java:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:57)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1404)
    at org.netbeans.nbbuild.CustomJavac.compile(CustomJavac.java:102)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1133)
    at org.netbeans.nbbuild.CustomJavac.execute(CustomJavac.java:83)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
    at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:306)
    at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:225)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
Caused by: java.lang.ClassNotFoundException: com.sun.java.help.search.Indexer
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 49 more
C:\netbeans-11.0-bin\netbeans\harness\suite.xml:163: The following error occurred while executing this line:
C:\netbeans-11.0-bin\netbeans\harness\common.xml:201: Compile failed; see the compiler error output for details.

0 个答案:

没有答案