Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags when using lombok

前端 未结 9 1644
一整个雨季
一整个雨季 2020-11-28 11:44

I have following dependency in pom.xml:


    org.projectlombok
    lombok

        
相关标签:
9条回答
  • 2020-11-28 12:17

    I have the same problem and I solve it by adding this code in pom.xml

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok-maven-plugin</artifactId>
        <version>1.18.0.0</version>
    </dependency>
    
    0 讨论(0)
  • 2020-11-28 12:17

    I encountered this issue when upgrading my project from JDK 8 to JDK 12 and using gradle instead of maven and using the io.franzbecker:gradle-lombok gradle plugin to configure lombok automatically.

    In this scenario changing buildScript.dependencies from classpath "io.franzbecker:gradle-lombok:1.14" to classpath "io.franzbecker:gradle-lombok:3.2.0" did the trick for me.

    0 讨论(0)
  • 2020-11-28 12:19

    Solved the issue by upgrading lombok version from 1.16.18 to 1.16.22 . I suspect any compatible version higher than .22 might do the trick.

    0 讨论(0)
  • 2020-11-28 12:28

    I am able to solve the problem in my maven project with Java-10 and Lombok 1.18.2.

    <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.2</version>
            <scope>provided</scope>
    </dependency>
    
    0 讨论(0)
  • 2020-11-28 12:30

    I had changed the lombok version and it worked for me.

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.16.22</version>
                <scope>provided</scope>
            </dependency>
    
    0 讨论(0)
  • 2020-11-28 12:31

    Solved this by:

    1) download the lombok-edge.jar,

    2) using following dependency:

    <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.16.21</version>
                <scope>system</scope>
                <systemPath>/Users/xxx/Downloads/lombok-edge.jar</systemPath>
            </dependency>
    
    0 讨论(0)
提交回复
热议问题