一直在尝试设置 Immutables 库,但尽管遵循指南 Eclipse 似乎没有在 target/generated-sources/annotations 文件夹中生成任何类
这是java编译器的截图->注释处理设置
工厂路径显示根据 Immutables 指南选择了 Immutables value-2.8.2.jar - https://immutables.github.io/immutable.html。
我已经运行了 Project -> Clean 然后 Project -> Build All
我在错误日志中收到错误:Java 注释处理器 org.immutables.processor.ProxyProcessor@63924c86 引发的异常
和相应的堆栈跟踪
java.lang.Exception: java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:172)
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:124)
at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:171)
at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:138)
at org.eclipse.jdt.internal.compiler.Compiler.processAnnotationsInternal(Compiler.java:958)
at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:932)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:450)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:386)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:371)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:318)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.incrementalBuildLoop(IncrementalImageBuilder.java:190)
at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:147)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:292)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:212)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl
at org.eclipse.jdt.internal.compiler.apt.model.PackageElementImpl.getEnclosingElement(PackageElementImpl.java:120)
at org.immutables.value.internal.$processor$.meta.$ImportRewriteDisabler.shouldDisableFor($ImportRewriteDisabler.java:81)
at org.immutables.value.internal.$processor$.meta.$ImportRewriteDisabler.shouldDisableFor($ImportRewriteDisabler.java:41)
at org.immutables.value.internal.$processor$.meta.$ValueType.sourceHeader($ValueType.java:112)
at org.immutables.value.internal.$processor$.$Generator_Immutables._t2__packageWhenTopLevel($Generator_Immutables.java:160)
at org.immutables.value.internal.$processor$.$Generator_Immutables$FragmentDispatch.run($Generator_Immutables.java:19964)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$Intrinsics.$($Intrinsics.java:96)
at org.immutables.value.internal.$processor$.$Generator_Immutables._t4__generateImmutable($Generator_Immutables.java:320)
at org.immutables.value.internal.$processor$.$Generator_Immutables$FragmentDispatch.run($Generator_Immutables.java:19966)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$Intrinsics.$($Intrinsics.java:96)
at org.immutables.value.internal.$processor$.$Generator_Immutables$1.run($Generator_Immutables.java:23)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$Output$7.invoke($Output.java:177)
at org.immutables.value.internal.$generator$.$Intrinsics.$($Intrinsics.java:96)
at org.immutables.value.internal.$processor$.$Generator_Immutables._t0__generate($Generator_Immutables.java:20)
at org.immutables.value.internal.$processor$.$Generator_Immutables$FragmentDispatch.run($Generator_Immutables.java:19962)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$AbstractGenerator.invoke($AbstractGenerator.java:57)
at org.immutables.value.internal.$processor$.$Processor.process($Processor.java:81)
at org.immutables.value.internal.$generator$.$AbstractGenerator.process($AbstractGenerator.java:87)
at org.immutables.processor.ProxyProcessor.process(ProxyProcessor.java:72)
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:142)
... 26 more
我究竟做错了什么?