IntelliJ IDEA+JDK10+Lombok16出现以下问题:lombok.javac.apt.LombokProcessor could not be initialized
Warning:(9, 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.<init>(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.<init>(JavacProcessingEnvironment.java:674)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:771)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:866)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(JavacProcessingEnvironment.java:110)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1202)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1311)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1250)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:928)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:198)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:453)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:317)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:244)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:202)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1314)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:991)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1063)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:954)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:787)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:376)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:183)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308)
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:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
maven里面讲lombok升级一下即可,旧版本1.16某个版本或以下有这个问题,1.18完美解决
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.0</version>
</dependency>
问题发现IntelliJ IDEA+JDK10+Lombok16出现以下问题:lombok.javac.apt.LombokProcessor could not be initializedWarning:(9, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run ...
今天从git上当了一个项目,等依赖加载完成之后启动项目,控制台提示 :Lombok will not run during this compilation。
以为是lombok依赖没有正常下载,但是pom文件没有问题,
怀疑是我idea是最新版的问题,或者会不会是jdk版本的问题,查看配置,原来默认最新版的idea这里配置的是11,改成低版本,我用的8就好了
Idea中试用Lombok插件时,运行程序和打包均失败,提示错误:
Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
使用的Lombok版本和jdk版本不兼容。
大多数人遇到的问题是使用的lombok版本过低,在jdk11环境下运行错误。
解决办法有两个
记录一个Lombok,在jdk10下面无法启动的问题,lombok.javac.apt.LombokProcessor could not be initialized.
在 IntelliJ IDEA 中,如果您打开的文件不是可运行文件,它就不能直接在编辑器中运行。这可能是因为您打开的文件类型不支持运行,或者您没有正确配置运行该文件的环境。
如果您想运行 Java 文件,您可以创建一个运行配置来运行它。您可以按照以下步骤操作:
1. 确保您已经安装了 JDK 并正确配置了您的环境变量。
2. 打开您想要运行的 Java 文件。
3. 单击菜单栏中的“运行”选项。
4. 选择“Edit Configurations”。
5. 在左侧窗格中选择“Application”。
6. 单击右上角的“+”按钮添加一个新的运行配置。
7. 配置您的运行选项,例如指定您的主类,您的运行参数等。
8. 单击“OK”保存您的配置。
9. 然后再次单击菜单栏中的“运行”选项,并选择您刚刚创建的运行配置。
如果您想运行其他类型的文件,请参考 IntelliJ IDEA 的官方文档以获取更多信息。