在 STS 4 (Eclipse 4.21.0) 中打开 .aj 文件时出错

Error when opening .aj file in STS 4 (Eclipse 4.21.0)

2021 年 11 月 15 日更新

另外看起来这可能已经被报告过,只是尚未发布修复程序。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=575897

如果有人有解决方法,我们将不胜感激。

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

原始问题

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

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

此外,如果我在包资源管理器中简单地单击一个 .aj 文件,就会弹出一个窗口,显示“出现问题”和“发生错误。有关更多详细信息,请参阅错误日志。”和同样的例外。日志仅包含相同的异常。

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

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

我的 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(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.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.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.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.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.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.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.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.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.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.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.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.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(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文件改成指向Java11 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

感谢您提醒我注意这个问题。我没有订阅 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 核心 API 更改导致 AJDT 与 Eclipse 2021-09 不兼容引起的。相同的更改不会影响当前候选版本 1.9.8.RC2 中的 AspectJ,但 AJDT 似乎从继承层次结构中的祖先 class 访问以前受保护的字段。这需要调整为使用 getter 方法,正如附加到 AJDT Bugzilla 问题的补丁所示。

背景:虽然我正在帮助维护 AspectJ 本身和 AspectJ Maven 插件(组 ID dev.aspectj),但 AJDT 多年来一直没有专门的维护者,只是由 AspectJ 团队维持生命,过去主要由 Andy Clement 组成,现在由我组成,因为 Andy 非常忙(我也是,只是少了一点)。术语“保持活动状态”意味着,我们已经并且正在做最低限度的工作以保持 AJDT 编译并且不为主要用例抛出任何令人讨厌的异常。我对一般的 OSGi 和特别是 Eclipse 插件的了解为零,即我作为一个业余爱好者在那里打补丁。抱歉没有更好的消息。

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


更新:我已经发布了一个 AJDT 版本,它应该可以与 Eclipse 2021-09 一起使用。有关详细信息,请参阅我的 comment in ADJT issue #575897