I'm trying to add an Aspect class to my Aspect Project. I get this error:
An error has occurred. See error log for more details.
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 @9ae2810; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @60eb5d5b)
I cannot open the *.aj files.
I've tried:
- Creating a new package -> same error.
- Adding simple Java classes and test them. They work without the *.aj files.
- Looking for answers online -> no working solution.
- Using Java 11 and Java 17.
My system:
- OSX 12.3.1. M1 chip.
- Eclipse Version: 2022-03 (4.23.0)
- AspectJ 1.9
CodePudding user response:
AJDT works with Java 17 and 18, you just need to install the right version. The AJDT version also needs to match the Eclipse version.
For more information, see the AspectJ quick guide about setting up a development environment, section "Eclipse".