一、背景
今天在本地调试一个刚接触的代码工程时,遇到如下错误:
java: Error during the transformation of 'com.aicloud.data.util.ExcelUtils'; post-compiler 'lombok.bytecode.SneakyThrowsRemover' caused an exception: java.lang.IllegalArgumentException: Unsupported class file major version 63 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:195) at org.objectweb.asm.ClassReader.<init>(ClassReader.java:176) at org.objectweb.asm.ClassReader.<init>(ClassReader.java:162) at lombok.bytecode.AsmUtil.fixJSRInlining(AsmUtil.java:37) at lombok.bytecode.SneakyThrowsRemover.applyTransformations(SneakyThrowsRemover.java:46) at lombok.core.PostCompiler.applyTransformations(PostCompiler.java:43) at lombok.core.PostCompiler$1.close(PostCompiler.java:76) at jdk.compiler/com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1508) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:738) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1635) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1603) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152) 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:237) at org.jetbrains.jps.incremental.java.JavaBuilder.lambda$compileJava$2(JavaBuilder.java:524) at org.jetbrains.jps.incremental.java.JavaBuilder.invokeJavac(JavaBuilder.java:587) at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:522) at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:365) at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:290) at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:244) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1523) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1153) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1303) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1118) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:889) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:471) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:197) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:150) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:357) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:179) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:218) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
这是由于java版本太高了导致的。
二、解决办法
依次点击【File】、【Settings】、【Build,Ex....】、【Compiler】、【Java Compiler】
然后,将报错所在项目的java版本降低。
再次启动代码工程时,就会看不到错误了。