不可变物没有 类 正在生成 eclipse
Immutables no classes being generated eclipse
一直在尝试设置 Immutables 库,但尽管遵循了指南,Eclipse 似乎并未在 target/generated-sources/annotations 文件夹
中生成任何 类
这是 java 编译器 -> 注释处理设置的屏幕截图
工厂路径显示根据不可变指南选择了不可变值 2.8。2.jar -- https://immutables.github.io/immutable.html。
我已经 运行 项目 -> 清理然后项目 -> 全部构建
我在错误日志中收到一条错误消息:
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.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.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.run($Generator_Immutables.java:23)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$Output.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
我做错了什么?
您的不可变 jar 太新或太旧(或者您用于 运行 您的 eclipse 的 Java 版本太新或太旧)。
你可以在eclipse中查看java版本:找到'about eclipse'选项(在macs的Eclipse菜单下,我认为它在其他操作系统的'help'下),然后选择配置选项卡。检查那里的 java.home=....
条目,它将指向用于启动 eclipse 本身的 JVM。那就是抛出那些错误, 或 ,不可变系统附带一个内部编译器(并且 ecj 通常是项目使用的 java 解析器,因为它快速且开源),在这种情况下,就是抛出错误的那个。很难从堆栈跟踪中判断出哪一个有问题。
所以,我会检查您的不可变 dep 的版本,如果它很旧,请更新它。然后我会检查您正在 运行ning eclipse 的 VM,如果它很旧,请更新它。
实际上,我会放弃不可变变量而只使用 lombok,但是,我会:P
一直在尝试设置 Immutables 库,但尽管遵循了指南,Eclipse 似乎并未在 target/generated-sources/annotations 文件夹
中生成任何 类这是 java 编译器 -> 注释处理设置的屏幕截图
工厂路径显示根据不可变指南选择了不可变值 2.8。2.jar -- https://immutables.github.io/immutable.html。
我已经 运行 项目 -> 清理然后项目 -> 全部构建
我在错误日志中收到一条错误消息: 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.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.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.run($Generator_Immutables.java:23)
at org.immutables.value.internal.$generator$.$Templates$Fragment.invoke($Templates.java:248)
at org.immutables.value.internal.$generator$.$Output.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
我做错了什么?
您的不可变 jar 太新或太旧(或者您用于 运行 您的 eclipse 的 Java 版本太新或太旧)。
你可以在eclipse中查看java版本:找到'about eclipse'选项(在macs的Eclipse菜单下,我认为它在其他操作系统的'help'下),然后选择配置选项卡。检查那里的 java.home=....
条目,它将指向用于启动 eclipse 本身的 JVM。那就是抛出那些错误, 或 ,不可变系统附带一个内部编译器(并且 ecj 通常是项目使用的 java 解析器,因为它快速且开源),在这种情况下,就是抛出错误的那个。很难从堆栈跟踪中判断出哪一个有问题。
所以,我会检查您的不可变 dep 的版本,如果它很旧,请更新它。然后我会检查您正在 运行ning eclipse 的 VM,如果它很旧,请更新它。
实际上,我会放弃不可变变量而只使用 lombok,但是,我会:P