1

2021 年 11 月 15 日更新

看起来这可能已经被报告过了,而且修复程序还没有发布。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=575897

如果有人有解决方法,仍然会受到赞赏。

我现在可以在不同的编辑器中编辑文件,但这是一个很大的痛苦。

原始问题

无法在 STS 4.12.1.RELEASE 中打开 aspectj 文件 (*.aj)

每当我尝试打开 .aj 文件时,Eclipse 都会给出错误“无法初始化编辑器”并引发以下异常。

此外,如果我在 Package Explorer 中单击 .aj 文件,会弹出一个弹出窗口,显示“出现问题”和“发生错误。有关详细信息,请参阅错误日志。” 和同样的例外。日志只包含相同的异常。

它似乎与Equinox有关,因此我尝试从STS 4中卸载Equinox,但无法全部卸载(显然,由于其他插件依赖于它),并且错误仍然存​​在。

我正在使用“开箱即用”的 STS 4,仅进行以下附加修改:

  • AspectJ 开发工具 2.2.4.202103162301
  • AJDT 的 Maven 集成(可选)0.14.0.201302011330
  • 龙目岛 1.18.22

我的 maven 项目依赖于 AspectJ 1.9.7 和 maven-aspectj-plugin 1.14.0,我正在运行 JDK 11。

java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71dac63f; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @629dfb5a)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.generateInfos(AJCompilationUnit.java:231)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:597)
at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:43)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:740)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:806)
at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:98)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:1039)
at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:481)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1284)
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4183)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:262)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1479)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2554)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2527)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1410)
at org.eclipse.ajdt.internal.ui.editor.AspectJEditor.doSetInput(AspectJEditor.java:359)
at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3173)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2290)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3190)
at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215)
at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527)
at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:51)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:82)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:64)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1078)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

这是我的 .log 文件的内容,删除了大部分堆栈跟踪以适应这个问题:

!SESSION 2021-11-15 13:42:08.464 -----------------------------------------------
eclipse.buildId=4.12.1.202110260750
java.version=17
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4

!ENTRY org.eclipse.jface 2 0 2021-11-15 13:42:15.608
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-15 13:42:15.608
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
    ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
        Open a type in a Java editor,
        Category(org.eclipse.ui.category.navigate,Navigate,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5b028f58,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
    ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
        ,
        Category(org.eclipse.lsp4e.category,Language Servers,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1e4d93f7,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)

!ENTRY org.eclipse.egit.ui 2 0 2021-11-15 13:42:23.827
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\david'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.jface 4 2 2021-11-15 13:42:38.406
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    ...

!ENTRY org.eclipse.ui 4 4 2021-11-15 13:42:38.819
!MESSAGE Unable to create part
!STACK 1
org.eclipse.ui.PartInitException: Editor could not be initialized.
    at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3206)
    at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215)
    at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
    ...

Caused by: java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
    ...

!SUBENTRY 1 org.eclipse.ui.workbench.texteditor 4 0 2021-11-15 13:42:38.820
!MESSAGE Editor could not be initialized.
!STACK 0
java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    ...

2021 年 11 月 16 日更新

将 .ini 文件更改为指向 Java 11 jvm,但仍然出现异常: .log 文件的新开始:

!SESSION 2021-11-16 09:08:49.754 -----------------------------------------------
eclipse.buildId=4.12.1.202110260750
java.version=11.0.12
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4
4

1 回答 1

4

感谢您提请我注意这个问题。我没有订阅 AJDT 和 AspectJ Bugzilla 项目,即我今天在阅读这个问题时才注意到有问题。

java.lang.IllegalAccessError:
  class org.eclipse.ajdt.core.javaelements.AJCompilationUnit
  tried to access private field
  org.eclipse.jdt.internal.core.JavaElement.parent 

该问题是由于 JDT Core 中的 API 更改导致 AJDT 与 Eclipse 2021-09 不兼容引起的。相同的更改不会影响当前候选版本 1.9.8.RC2 中的 AspectJ,但 AJDT 似乎从继承层次结构的祖先类访问以前受保护的字段。这需要调整为使用 getter 方法,附加到 AJDT Bugzilla 问题的补丁也表明了这一点。

背景:虽然我正在帮助维护 AspectJ 本身和 AspectJ Maven 插件(组 ID dev.aspectj),但 AJDT 多年来一直没有专门的维护者,而只是由 AspectJ 团队维持生命,该团队主要包括安迪克莱门特和现在的我,因为安迪非常忙(我也是,只是少了一点)。“保持活力”一词的意思是,我们已经并且正在做最低限度的工作来保持 AJDT 编译,并且不会为主要用例抛出任何令人讨厌的异常。我对一般的 OSGi 和特别是 Eclipse 插件的了解为零,即我作为一个业余爱好者在那里修补。很抱歉没有更好的消息。

今天在一个安静的时间里,我在 AJDT 中从 AspectJ 升级了一些上游的东西,并经历了一大堆需要调整的 Eclipse API 更改,而不仅仅是补丁中解决的那个。目前,我不知道如何修复它们。这将是反复试验,而且我只有偶尔的时间,所以我无法预测何时能够发布一个有效的 AJDT 版本。


更新:我已经发布了一个 AJDT 版本,它应该适用于 Eclipse 2021-09。有关更多详细信息,请参阅我在 ADJT 问题 #575897 中的评论。

于 2021-11-18T17:39:08.797 回答