Lombok + Eclipse Kepler

送分小仙女□ 提交于 2019-12-11 07:58:50

问题


So, after updating eclipse from Helios to Kepler, I found my Lombok-dependent project to be full of errors, due to eclipse not seeing the added methods by @Getter and stuff, so i reinstalled Lombok, however eclipse either crashed or just didnt see the methods, depending on how i run it. If I ran it from eclipse.exe from windows explorer, it starts without lombok, and if i type it into the run dialog it just crashes like this:

Java was started but returned exit code=1
   C:\Windows\system32\javaw.exe
   -Dosgi.requiredJavaVersion=1.6
   -Xms40m
   -Xmx512m
   -javaagent:lombok.jar
   -Xbootclasspath/a:lombok.jar
   -XX:MaxPermSize=256m
   -jar C:\Program Files\eclipse \\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
   -os win32
   -ws win32
   -arch x86_64
   -showsplash C:\Program Files\eclipse\\plugins\org.eclipse.platform_4.3.1.v20130911-1000\splash.bmp
   -launcher C:\Program Files\eclipse\eclipse.exe
   -name Eclipse
   --launcher.library C:\Program Files\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835\eclipse_1503.dll
   -startup C:\Program Files\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
   --launcher.appendVmargs
   -exitdata 198c_5c
   -product org.eclipse.epp.package.jee.product
   -vm C:\Windows\system32\javaw.exe
   -vmargs
   -Dosgi.requiredJavaVersion=1.6
   -Xms40m
   -Xmx512m
   -javaagent:lombok.jar
   -Xbootclasspath/a:lombok.jar
   -XX:MaxPermSize=256m
   -jar C:\Program Files\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar 

回答1:


I have seen the same problem after installing lombok with Eclipse Kepler. To start Eclipse I defined a symbolic link which points to the Eclipse installation deirectory and which passes a -data option to eclipse.exe.

The problem was that the references to lombok.jar in the eclipse.ini file were relative. I have changed these references to absolute references and since then lombok works.

In the file eclipse.ini I replaced the lines

-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar

with

-javaagent:D:\eclipse\kepler\lombok.jar
-Xbootclasspath/a:D:\eclipse\kepler\lombok.jar


来源:https://stackoverflow.com/questions/20449144/lombok-eclipse-kepler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!