Lombok plug-in installation (Eclipse/SpringToolSuite4) (Windows and Mac)
introduce
Lombok
is the注解化
solution for Java data classes (i.e. JavaBeans). Using the @Data
annotation, methods such as set, get, hashCode, and toString in the data class no longer need to be written manually.
The principle of Lombok is to automatically generate set, get and other methods for data classes annotated with @Data through the compiler plug-in. Therefore, the Java editor is required to install the Lombok plug-in.
Higher versions of IDEA (from version 2020.3 onwards) have automatically integrated Lombok without the need to install additional plug-ins.
Eclipse and its derivative IDEs (such as SpringToolSuite4, etc.) need to use the Lombok installation package and manually install the Lombok plug-in into Eclipse.
This article takesSpringToolSuite4
as an example to introduce the installation steps of the Lombok plug-in.
Download the Lombok installation package
Official website download jar package
Official website download address:Download (projectlombok.org)
The downloaded installation package is as follows:
Plug-in installation steps (Windows)
The Lombok plug-in installation steps are as follows:
- Install the Lombok plugin. Run the Lombok installation package and install the plug-in into SpringToolSuite4
- Restart SpringToolSuite4 to make the plug-in take effect
- Check if Lombok plugin is enabled
Install Lombok plugin
- Soukai
lombak.jar
. - The Lombok installation program will automatically search for Eclipse and Eclipse-based IDEs that have been installed on the computer, and list the installation addresses in
IDEs
. - If the IDE is not found in the automatic search, you can click the
Specify location
button at the bottom left to manually select the IDE. - Point 击
Install / Update
. - Successful installation.
- Lombok plug-in installation page
- Manually select IDE
- Successful installation
Lombok has been installed in SpringToolSuite4
.
Restart IDE
Restart SpringToolSuite4 to make the Lombok plug-in take effect.
Check if Lombok plugin is enabled
Check whether the Lombok plug-in in SpringToolSuite4 has been enabled.
You can check whether your eclipse has lombok enabled in the eclipse's
about
dialog box. The lombok version will be listed at the end of the copyright text:
Plug-in installation steps (Mac)
Installing the Lombok plug-in on a Mac computer is similar to the Windows platform.
- Double-click
lombak.jar
to automatically detect the installed SpringToolSuite4 and select the version that needs to be installed. - If the IDE is not found in the automatic search, you can click the
Specify location
button at the bottom left to manually select the IDE. - Point 击
Install / Update
. - Successful installation.
The screenshots showing differences between the Windows version and the Windows version are as follows:
Reference (specific usage of Lombok)
For specific usage of Lombok, please refer to the following article:
"Annotation solution for Java data classes (JavaBean): @Data (Lombok implementation)"