Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get Intellij to use the AspectJ compiler

Everything I see online just says to select the "ajc" compiler from the list of compilers, but that's not an option for me. I've got javac, jikes, eclipse, and javac-in-process, but that's it.

As it is my project compiles from the command line with maven, but if I type anything in the IDE that uses an aspect, I get compiler warnings.

like image 690
Phil Kulak Avatar asked Feb 02 '12 05:02

Phil Kulak


People also ask

How do I use AspectJ in IntelliJ?

AspectJ support is not bundled with IntelliJ IDEA starting with IntelliJ IDEA 2021.2. To be able to use this technology in your application, download and install the AspectJ plugin following the instructions in section Install plugins.

How do I find my compiler in IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment| Compiler.

What is AJC compiler?

Description. The ajc command compiles and weaves AspectJ and Java source and . class files, producing . class files compliant with any Java VM (1.1 or later). It combines compilation and bytecode weaving and supports incremental builds; you can also weave bytecode at run-time using Load-Time Weaving.

What is AspectJ Maven plugin?

This plugin weaves AspectJ aspects into your classes using the AspectJ compiler ("ajc"). Typically, aspects are used in one of two ways within your Maven reactors: As part of a Single Project, implying aspects and code are defined within the same Maven project.


1 Answers

Make sure AspectJ Support plug-in is enabled in Settings (Preferences on Mac) | Plugins. Follow the documentation for more details.

When using proper Maven project, ajc compiler will be enabled automatically.

like image 58
CrazyCoder Avatar answered Sep 17 '22 12:09

CrazyCoder