Netbeans:意外异常

zaqlnxep  于 2022-11-10  发布在  其他
关注(0)|答案(1)|浏览(170)

我在我的PC上安装了Apache Netbeans。一切都运行正常。但第二天我想继续我的工作,但从那以后我一直得到一个例外:

A java.lang.IllegalAccessError exception has occurred.
Please report this at https://issues.apache.org/jira/projects/NETBEANS/issues,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your 
C:\Users\svent\AppData\Roaming\NetBeans\12.0\var\log folder.

我有以下设置:

产品版本:Apache NetBeans集成开发环境12.0
Java:17; OpenJDK 64位服务器虚拟机17+35-2724
操作系统:Windows 10
我试过卸载所有的东西并重新安装。我也试过使用Java 11或Java 14。我也试过从AppData中的Netbeans删除12. 0文件夹。但这些都没有帮助。
以下是确切的例外:

java.lang.IllegalAccessError: superclass access check failed: class org.netbeans.lib.nbjavac.services.CancelAbort (in unnamed module @0x6a51d5d0) cannot access class com.sun.tools.javac.util.Abort (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x6a51d5d0
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
    at org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:287)
    at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:246)
    at org.netbeans.ProxyClassLoader.doFindClass(ProxyClassLoader.java:174)
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:125)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    at org.netbeans.modules.java.source.parsing.JavacParserFactory.createPrivateParser(JavacParserFactory.java:79)
    at org.netbeans.api.java.source.JavaSource$JavaSourceAccessorImpl.createCompilationController(JavaSource.java:739)
    at org.netbeans.modules.java.source.JavaSourceUtilImpl.getModuleInfoHandle(JavaSourceUtilImpl.java:271)
    at org.netbeans.modules.java.preprocessorbridge.spi.JavaSourceUtilImpl$MyAccessor.getModuleInfoHandle(JavaSourceUtilImpl.java:119)
    at org.netbeans.modules.java.preprocessorbridge.api.ModuleUtilities.init(ModuleUtilities.java:122)
    at org.netbeans.modules.java.preprocessorbridge.api.ModuleUtilities.resolveModule(ModuleUtilities.java:104)
    at org.netbeans.modules.java.api.common.classpath.ModuleClassPaths$ModuleInfoClassPathImplementation.getResources(ModuleClassPaths.java:882)
    at org.netbeans.api.java.classpath.ClassPath.entries(ClassPath.java:363)
    at org.netbeans.spi.java.classpath.support.MuxClassPathImplementation.getResources(MuxClassPathImplementation.java:90)
    at org.netbeans.api.java.classpath.ClassPath$SPIListener.propertyChange(ClassPath.java:1343)
    at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:190)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
    at org.netbeans.spi.java.classpath.support.MuxClassPathImplementation.propertyChange(MuxClassPathImplementation.java:127)
    at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:190)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
    at org.netbeans.modules.java.api.common.classpath.ClassPathProviderImpl$SourceLevelSelector.propertyChange(ClassPathProviderImpl.java:1575)
    at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:190)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
    at org.netbeans.spi.project.support.ant.SequentialPropertyEvaluator.stateChanged(SequentialPropertyEvaluator.java:185)
    at org.openide.util.WeakListenerImpl$Change.stateChanged(WeakListenerImpl.java:331)
    at org.openide.util.ChangeSupport.fireChange(ChangeSupport.java:108)
    at org.openide.util.ChangeSupport.fireChange(ChangeSupport.java:94)
    at org.netbeans.spi.project.support.ant.ProjectProperties$PP$2.run(ProjectProperties.java:365)
    at org.netbeans.spi.project.support.ant.ProjectProperties$PP$2.run(ProjectProperties.java:363)
    at org.netbeans.modules.openide.util.DefaultMutexImplementation.readAccess(DefaultMutexImplementation.java:188)
    at org.openide.util.Mutex.readAccess(Mutex.java:193)
    at org.netbeans.spi.project.support.ant.ProjectProperties$PP.fireChange(ProjectProperties.java:371)
    at org.netbeans.spi.project.support.ant.ProjectProperties$PP.put(ProjectProperties.java:225)
    at org.netbeans.spi.project.support.ant.ProjectProperties.putProperties(ProjectProperties.java:107)
    at org.netbeans.spi.project.support.ant.AntProjectHelper$6.run(AntProjectHelper.java:740)
    at org.netbeans.spi.project.support.ant.AntProjectHelper$6.run(AntProjectHelper.java:738)
    at org.netbeans.modules.openide.util.DefaultMutexImplementation.writeAccess(DefaultMutexImplementation.java:229)
    at org.openide.util.Mutex.writeAccess(Mutex.java:246)
    at org.netbeans.spi.project.support.ant.AntProjectHelper.putProperties(AntProjectHelper.java:738)
    at org.netbeans.modules.java.j2seproject.api.J2SEProjectBuilder.createProject(J2SEProjectBuilder.java:579)
    at org.netbeans.modules.java.j2seproject.api.J2SEProjectBuilder.lambda$build$0(J2SEProjectBuilder.java:312)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
    at org.netbeans.modules.java.j2seproject.api.J2SEProjectBuilder.build(J2SEProjectBuilder.java:310)
    at org.netbeans.modules.java.j2seproject.J2SEProjectGenerator.createProject(J2SEProjectGenerator.java:59)
    at org.netbeans.modules.java.j2seproject.ui.wizards.NewJ2SEProjectWizardIterator.instantiate(NewJ2SEProjectWizardIterator.java:187)
    at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1048)
    at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:602)
    at org.netbeans.modules.project.ui.NewProjectWizard.handleInstantiate(NewProjectWizard.java:51)
    at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:436)
    at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:228)
    at org.openide.loaders.TemplateWizardIteratorWrapper$ProgressInstantiatingIterator.instantiate(TemplateWizardIteratorWrapper.java:155)
    at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1602)
    at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1546)
    at org.openide.WizardDescriptor.access$2300(WizardDescriptor.java:67)
    at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2233)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

我希望有人能帮我,因为我不知道该怎么办了。

tgabmvqs

tgabmvqs1#

您正在运行带有JDK 17的NetBeans 12.0。这不是受支持的组合。
您有两个选择:

  • 请继续使用NetBeans 12.0,并改用JDK 14。
  • 继续使用JDK 17,改用NetBeans 12.5(在这种情况下,您不需要先卸载NetBeans 12.0)。

有关受支持的Java版本的详细信息,请参见NetBeans 12.0NetBeans 12.5的发行说明。
类似的问题在这里很常见,不幸的是NetBeans没有更好地主动防止不支持的JDK被使用。也就是说,在NetBeans的防御中:

  • 您发布的错误消息明确要求您查看NetBeans日志文件(messages.log)以获取更多信息。
  • NetBeans发行说明始终明确说明特定NetBeans发行版支持哪些Java版本,而不应做出任何假设。例如,对于NetBeans 12.5,支持的发行版为"JDK LTS releases 8 and 11, with experimental support for JDK 17"。该信息非常重要,因为它表明尽管JDK 17具有“试验性支持,”但不支持JDK 12到JDK 16。

相关问题