我正在使用delombok来生成getter,setter,hashCode,equlas& toString以编程方式。我正在使用Eclipse luna。代码与JDK 1.8
完全正常,但是当我将版本降级为JDK 1.7
时,它会抛出以下错误:
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at lombok.launch.Delombok.delombok(Delombok.java:50)
... 4 more
Caused by: java.lang.NoSuchFieldError: NATIVE_HEADER_OUTPUT
at com.sun.tools.javac.file.Locations.initHandlers(Locations.java:654)
at com.sun.tools.javac.file.Locations.<init>(Locations.java:92)
at com.sun.tools.javac.util.BaseFileManager.createLocations(BaseFileManager.java:85)
at com.sun.tools.javac.util.BaseFileManager.<init>(BaseFileManager.java:71)
at com.sun.tools.javac.file.JavacFileManager.<init>(JavacFileManager.java:125)
at com.sun.tools.javac.file.JavacFileManager$1.make(JavacFileManager.java:115)
at com.sun.tools.javac.file.JavacFileManager$1.make(JavacFileManager.java:113)
at com.sun.tools.javac.util.Context.get(Context.java:150)
at com.sun.tools.javac.util.Context.get(Context.java:193)
at com.sun.tools.javac.comp.Enter.<init>(Enter.java:142)
at com.sun.tools.javac.comp.Enter.instance(Enter.java:115)
at com.sun.tools.javac.comp.MemberEnter.<init>(MemberEnter.java:101)
at com.sun.tools.javac.comp.MemberEnter.instance(MemberEnter.java:94)
at com.sun.tools.javac.comp.Attr.<init>(Attr.java:115)
at com.sun.tools.javac.comp.Attr.instance(Attr.java:102)
at com.sun.tools.javac.comp.Resolve.<init>(Resolve.java:122)
at com.sun.tools.javac.comp.Resolve.instance(Resolve.java:158)
at com.sun.tools.javac.comp.Check.<init>(Check.java:111)
at com.sun.tools.javac.comp.Check.instance(Check.java:99)
at com.sun.tools.javac.code.Types.<init>(Types.java:118)
at com.sun.tools.javac.code.Types.instance(Types.java:104)
at com.sun.tools.javac.jvm.ClassReader.<init>(ClassReader.java:291)
at com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:253)
at com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:348)
at lombok.javac.CommentCatcher.create(CommentCatcher.java:40)
at lombok.delombok.Delombok.delombok(Delombok.java:479)
... 9 more
我的maven依赖关系如下:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>compiler</artifactId>
<version>1.9.5</version>
</dependency>
任何人都可以对此有所了解吗?