spring boot 2.1学习笔记【异常】lombok.javac.apt.LombokProcessor could not be initialized

springboot系列学习笔记全部文章请移步值博主专栏**: spring boot 2.X/spring cloud Greenwich。
由于是一系列文章,所以后面的文章可能会使用到前面文章的项目。springboot系列代码全部上传至GitHub:https://github.com/liubenlong/springboot2_demo
本系列环境:Java11;springboot 2.1.1.RELEASE;springcloud Greenwich.RELEASE;MySQL 8.0.5;

@RestController
@Slf4j
public class HelloController {

    @GetMapping("/hello")
    public String hello() {
        log.info("s");
        return "Welcome to springboot2 world ~";
    }

}

上述使用到slf4j的日志功能时,启动报错:

Warning:(7, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM extends com.sun.tools.javac.main.DelegatingJavaFileManager implements javax.tools.StandardJavaFileManager
  	at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:148)
  	at lombok.javac.apt.InterceptingJavaFileManager.(InterceptingJavaFileManager.java:40)
  	at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:165)
  	at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:87)
  	at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87)
  	at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140)
  	at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69)
  	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.(JavacProcessingEnvironment.java:678)
  	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:778)
  	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:873)
  	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1214)
  	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1326)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
  	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
  	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
  	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:193)
  	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:448)
  	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:318)
  	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:243)
  	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:201)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1317)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:993)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1065)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:956)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:788)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:377)
  	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)
  	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
  	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:309)
  	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:137)
  	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235)
  	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
  	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  	at java.base/java.lang.Thread.run(Thread.java:834)
Error:(13, 9) java: 找不到符号
  符号:   变量 log
  位置: 类 com.example.controller.HelloController

网上很多文章都说是lombok插件没有按照,但是我是安装过了的。所以问题不是出在lombok插件上。
后来我将lombok升级到最新版本就可以了,看了是lombok老版本对于新版的IDEA或者springboot支持不是很好。

<dependency>
   <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.4</version>
    <scope>provided</scope>
</dependency>

springboot系列学习笔记全部文章请移步值博主专栏**: spring boot 2.X/spring cloud Greenwich。
由于是一系列文章,所以后面的文章可能会使用到前面文章的项目。springboot系列代码全部上传至GitHub:https://github.com/liubenlong/springboot2_demo
本系列环境:Java11;springboot 2.1.1.RELEASE;springcloud Greenwich.RELEASE;MySQL 8.0.5;

你可能感兴趣的:(异常,springboot,spring,boot,2.X/spring,cloud,Greenwich)