I upgraded recently to the new Eclipse version (Oxygen). I downloaded the lombok.jar from the website and installed it. This is how the eclipse.ini
looks like after installation:
-startup plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar --launcher.library C:\Users\xxx\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.500.v20170531-1133 -product org.eclipse.epp.package.jee.product -showsplash org.eclipse.epp.package.common --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.8 [email protected]/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ -javaagent:lombok.jar
I can use Lombok as seen here:
But when using the getters/setters and/or constructors in other classes I get the this errors:
Also these are my Eclipse and Lombok versions:
Eclipse Java EE IDE for Web Developers. Version: Oxygen Release (4.7.0) Build id: 20170620-1800 Lombok v1.16.18 "Dancing Elephant" is installed. https://projectlombok.org/
Anyone knows how I can fix it?
Eclipse 2020-12 (Eclipse 2020-12 Java) does not support Lombok. It runs fine, but the IDE shows errors for all Lombok generates getters/setters. The previous version of Eclipse work fine. You have to install lombok on your installation, otherwise Eclipse will not be able to handle the Lombok-Annotations.
Lombok in EclipseIf we're using Eclipse IDE, we need to get the Lombok jar first. The latest version is located on Maven Central. For our example, we're using lombok-1.18.
My env: java version "1.8.0_144"
Eclipse: Eclipse Java EE IDE for Web Developers. Version: Oxygen Release (4.7.0) Build id: 20170620-1800
Exit Eclipse(if it is open) and downloaded jar from https://projectlombok.org/download
execute command: java -jar lombok.jar
This command will open window as shown here https://projectlombok.org/setup/eclipse, install and quit the installer.
Add jar to build path/add it to pom.xml.
e.g. for Gradle build
annotationProcessor("org.projectlombok:lombok") compileOnly("org.projectlombok:lombok")
Enable annotation processing
in the respective IDE. That's it. It worked. I did not change eclipse init script.Note: Read the note in following image regarding -vm options If you start Eclipse with a custom -vm parameter, you'll need to add:
-vmargs -javaagent:<path-to-lombok-jar>/lombok.jar
as parameter as well
Above steps works for Photon Release (4.8.0)
- Lombok v1.18.2
, eclipse: Oxygen.3a Release (4.7.3a)
- Lombok v1.18.0
and eclipse: Neon.3 Release (4.6.3)
- Lombok v1.18.2
lombok success screen:
fyi,
For JDK - 10 and 11 support: Lombok version should be at least v1.18.4 (October 30th, 2018) or higher.
For MacBook Pro users (e.g. running macOs Sierra v10.12.6), in order to install lombok on Eclipse Oxygen (4.7.0) or Photon (4.8.0), using Java 1.8 (1.8.0_144), just do the following actions:
java -jar lombok.jar
;/tools/ide/eclipse/jee-oxygen/Eclipse.app/Contents/Eclipse/eclipse.ini
.On the menu bar, go to Eclipse > About Eclipse and validate that lombok is installed:
Lombok v1.16.18 "Dancing Elephant" is installed. https://projectlombok.org/
Be sure to scroll the text window down since the installed Lombok version appears in the text above the row of icons.
Finally, add lombok to your project's build path according to the building tool you're using. For Maven, for instance, use the following dependency:
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.18</version> <scope>provided</scope> </dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With