lombok 报错

Warning:(3, 8) java: Can't initialize javac processor due to (most likely) a class loader problem: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
      at lombok.javac.handlers.HandleHookGetter.(HandleHookGetter.java:72)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:348)
      at lombok.core.SpiLoadUtil$1$1.next(SpiLoadUtil.java:111)
      at lombok.javac.HandlerLibrary.loadAnnotationHandlers(HandlerLibrary.java:181)
      at lombok.javac.HandlerLibrary.load(HandlerLibrary.java:166)
      at lombok.javac.JavacTransformer.(JavacTransformer.java:47)
      at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:96)
      at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:124)
      at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:177)
      at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:73)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.(JavacProcessingEnvironment.java:500)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
      at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
      at com.sun.tools.javac.main.Main.compile(Main.java:523)
      at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
      at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
      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.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
      at java.lang.ClassLoader.findClass(ClassLoader.java:530)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at lombok.launch.ShadowClassLoader.loadClass(ShadowClassLoader.java:530)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 44 more

 

 

今天用这东西


    org.projectlombok
    lombok
    1.18.5-rangu.dl-SNAPSHOT

报上述错误,后来加各种slf的依赖,都没用。最后换了下版本号就行了。不解原因。


    org.projectlombok
    lombok
    1.16.18
    provided

你可能感兴趣的:(随笔)