Configure Eclipse Snap with Lombok
by JayPi4c
Eclipse was the first real IDE I used to code in Java. This more or less changed to Intellij during the time I studied. But I still have reasons to come back to Eclipse from time to time. Using Ubuntu, I really like the convenience of just installing Eclipse with one command using snap. This is, it just takes the following command to have a fully working Eclipse IDE on your machine:
sudo snap install eclipse --classic
The problem with this way of installing Eclipse is, that it does not come with the Lombok plugin. Lombok is a really nice tool to reduce boilerplate code in Java. It does this by adding annotations to your code, which are then processed by the Lombok compiler. This is really nice, but it requires you to install the Lombok plugin for your IDE. This is not a problem, if you install Eclipse the normal way. But if you install it using snap, you have to do some extra steps to get it to work.
This website describes the steps you had to do to get it to work. But I also found an interesting thread on Stackoverflow that describes a more convenient way to do it. In the thread, they mention, that an update in the snap package of Eclipse allows to overwrite the eclipse.ini
file. As this is the only thing we need to do, in order to get Lombok to work with Eclipse, we can do the following steps:
- Install Eclipse using snap
- Download Lombok jar file (you may already have the jar on your machine in the maven m2 folder)
- Copy the default
eclipse.ini
file to$SNAP_USER_DATA/eclipse.ini
(e.g.~/snap/eclipse/XX/eclipse.ini
where XX is the version number of your Eclipse installation) (The defaulteclipse.ini
file can be found in the/snap/eclipse/XX/
folder) - Add the following line to the end of the
eclipse.ini
file:-javaagent:/path/to/lombok.jar
That’s it! Now you can use Lombok with Eclipse installed using snap.
tags: Ubuntu, Linux, Snap, Eclipse, LombokBack Home