Lombok and STS Problem - Undefined Method

I have a version of STS 3.6.3.SR1 based on Eclipse Luna 4.4.1.

I have taken the following steps:

1) Dip and run the lombak runnable jar and give the path to my STS. 2) I checked the vmargs entries but there was no Xbootclasspath and added so it had,

-vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Dorg.eclipse.swt.browser.IEVersion=10001 -Xms512m -Xmx1024m -javaagent:C:\tools\Lombok\lombok.jar -Xbootclasspath/a:C:\tools\Lombok\lombok.jar 

3) I have an exit and STS is open both from the shortcut and from the absent location of STS.exe

4) I checked the layout of my Java classes that are annotated with @Data and other lombak annotations. I see how getters and setters are generated. Even Auto assist displays this method.

5) I did Maven -> Update Project and even did Project Clean

6) CO confirmed that lombak is also installed from About STS help from help.

Even after all the above actions, there are many problems with the compiler that complain about the undefined getXXX () and setXXX () methods for all @Data or @Getter or @Setter annotations.

The Maven construct is successful, and the runtime behavior is excellent, since the class has its receivers and setters in compliance with the requirements.

Intelli J doesn't seem to be able to handle this, as other developers may use the library.

My pom also has the following entry:

 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.4</version> </dependency> 

How do i allow it?

PS: I downloaded Eclipse Kepler build on top of STS to enable JBoss Fuse Tooling.

+7
eclipse spring-tool-suite lombok eclipse-luna
May 27 '15 at 9:30
source share
5 answers

I had a similar problem that was resolved by changing the lobak dependency area in the pom.xml file.

The area was originally "provided", and I believe that I saw all the strange behavior that you described. For example, drop-down context-sensitive code expansion included the getter and setter methods. When I selected the getter method from the drop-down list, the method was correctly inserted into the source. After inserting the getter method, the STS prevented the method from being called as a compilation error, since it believed that the method did not exist.

After removing the β€œprovided” area from the lombok dependency, STS worked correctly, and the getter / setter methods could be added to the code, the code could be compiled / packed, and executed. Executed getter / setter methods.

+4
Jul 29 '15 at 2:23
source share

@Kartik R, thanks for your post. The following helped me solve the problem

  1. Go to https://projectlombok.org/, download and double-click on the bank and install in your IDE
  2. After that, open the .ini file and see if there are javaagent and Xbootclasspath variables in it .

In my case, the Xbootclasspath was missing, and when I added that it worked




 -Xbootclasspath/a:PATH_To_lambok.jar 
+3
Oct 31 '16 at 18:10
source share

I added -Xbootclasspath/a:lombok.jar as naga1990 mentioned , however it still didn't solve the problem. After running STS with -clean it worked.

+3
Apr 12 '17 at 5:51 on
source share

If you have already tried other methods, but they still do not work, you can try this:

If your project is based on Maven , STS configured it as AspectJ Capability, which will conflict with Lombok .

To solve this problem, remove Aspect Capability by right-clicking on the project β†’ AspectJ Tools β†’ Remove AspectJ Capability . Hope this works.

enter image description here

+1
Nov 27 '17 at 7:55
source share

I solved it as follows ... 1. downloaded the lombok UI Swing application ... namely, lombok.jar 2. launched it and entered the path sts manually to sts.exe, i.e. the full folder containing sts.exe 3. clicked on update / install 4. doing all of the above 3 steps, make sure that sts does not work at all. 5. Launch STS 6. Clean the project assembly.

0
Jan 25 '19 at 10:16
source share



All Articles