Analysis and Solution for Lombok Compilation Error in IntelliJ IDEA

Dec 05, 2025 · Programming · 8 views · 7.8

Keywords: IntelliJ IDEA | Lombok | Compilation Error

Abstract: This paper provides an in-depth analysis of the Lombok compilation error "You aren't using a compiler supported by lombok" in IntelliJ IDEA 2020.3. It explores the root cause by examining the processor information in the error message and explains the mismatch between supported compilers and the actual compiler used. Based on best practices, the paper presents the solution of adding the -Djps.track.ap.dependencies=false parameter to shared build process VM options, with comparisons to alternative approaches. The discussion also covers the distinction between HTML tags like <br> and characters for accurate technical expression.

Problem Background and Error Analysis

After upgrading to IntelliJ IDEA 2020.3 (Community Edition), many developers encountered issues running applications from the IDE. The specific error message reads: java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled. Your processor is: com.sun.proxy.$Proxy24 Lombok supports: sun/apple javac 1.6, ECJ. This error indicates that Lombok detects the current compiler is not in its supported list, thus automatically disabling its functionality.

Root Cause Investigation

The error message clearly states that the current processor is com.sun.proxy.$Proxy24, while Lombok only supports sun/apple javac 1.6 and ECJ compilers. This typically occurs when IntelliJ IDEA's internal build system, JPS (JetBrains Project System), attempts to track annotation processor dependencies, generating incompatible proxy classes. For example, when handling HTML tags in code, such as print("<br>"), angle brackets must be properly escaped to avoid parsing errors.

Core Solution

Based on best practices, the most effective solution is to add a specific VM parameter to IntelliJ IDEA's build configuration. The steps are as follows:

  1. Open IntelliJ IDEA settings
  2. Navigate to Build, Execution, Deployment → Compiler → Shared build process VM options
  3. Add the parameter: -Djps.track.ap.dependencies=false
  4. Rebuild the project

This parameter disables JPS tracking of annotation processor dependencies, preventing the generation of incompatible proxy processors. From a technical implementation perspective, when this parameter is set, the build system skips the dependency tracking phase and uses standard compiler paths directly.

Code Examples and Implementation Principles

To illustrate the issue more clearly, consider a simple Java class using Lombok annotations:

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class User {
    private String name;
    private int age;
}

Without proper configuration, Lombok cannot process these annotations during compilation because the proxy processor com.sun.proxy.$Proxy24 is unsupported. After adding the VM parameter, the build process bypasses this check, allowing Lombok to generate getter and setter methods normally. For instance, when processing strings containing special characters, like System.out.println("Tag example: <div>");, it is essential to escape angle brackets as &lt; and &gt;.

Comparison of Alternative Approaches

In addition to the primary solution, other answers propose different methods:

In comparison, adding the VM parameter directly targets the internal mechanisms of the build system, resulting in higher success rates. For example, when discussing technical concepts, distinguishing between HTML tags as text content (e.g., &lt;br&gt;) and as instructions (e.g., <br>) is crucial.

Preventive Measures and Best Practices

To avoid similar issues, developers are advised to:

  1. Check compatibility between Lombok plugins and project configurations before upgrading the IDE.
  2. Regularly update Lombok to stable versions, avoiding EAP (Early Access Program) releases.
  3. Standardize build configurations in team projects to ensure all members use the same VM parameter settings.

Furthermore, understanding the internal workings of the build system aids in faster diagnosis and resolution of compilation problems. For instance, when handling code containing XML or HTML fragments, proper escaping of special characters is key to ensuring code readability and security.

Conclusion

The primary cause of the Lombok compilation error in IntelliJ IDEA 2020.3 is the incompatibility between proxy processors generated by the build system and compilers supported by Lombok. By adding the -Djps.track.ap.dependencies=false parameter, dependency tracking is disabled, restoring Lombok's normal functionality. This method has been validated by the community and is highly reliable. Developers should master the analytical approach to such problems to respond quickly to similar technical challenges.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.