How to configure lombok in Eclipse

In the last article, we introduced the use of lombok in idea. Recently, everyone reported that eclipse is more used in the learning process than idea. Here is a summary of the usage of lombok in eclipse

need to prepare

1.lombok.jar

Download address: http://www.jb51.net/softs/549437.html

2. eclipse tools

step:

1. Put the downloaded lombok.jar in the folder of your own jar package and tool class


2. Copy the lombok.jar package and put it in the eclipse installation directory, which is the same level as eclipse.exe.


3. Open lombok.jar


Click here to open the local eclipse.exe (the default is to automatically search, if there is no automatic search, follow this method to load eclipse.exe)

Then click Install/Update and it's OK.


The installation is complete, let's test it


Create an entity class

import lombok.Data;

@Data // The data annotation in lombok, use this annotation to omit the get and set methods
public class User {
	
	private int id;
	private String name;
	private String sex;
}

The test results are as follows:

We successfully omitted get and set methods


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325843692&siteId=291194637