Back to Overview

Why I Did not Use Lombok in My Spring Boot Application for Two Months

Funny Experience

May 24, 2025Experience

When working with Spring Boot and Java, developers often seek ways to improve their productivity and simplify their code. One of the most popular tools for achieving this is Lombok, a Java library that helps eliminate boilerplate code, such as getters, setters, constructors, and toString methods, by using annotations. While Lombok is widely praised for its ability to reduce verbosity in code, I personally decided not to integrate it into my Spring Boot application for two months.


This decision wasn’t born out of a reluctance to use the tool or skepticism about its utility. In fact, I had used Lombok in previous projects and had enjoyed its benefits. However, during this period, I encountered compatibility issues with the latest Java versions, specifically Java 23, which is what ultimately caused me to delay using Lombok. The issue revolved around Lombok's support for newer Java versions and the need for an updated version of Lombok to ensure smooth integration. This article will explain the reasons behind my decision, delve into the technical details of why I couldn’t use Lombok with Java 23, and provide insights into the solution that eventually allowed me to resume using Lombok.  

The Appeal of Lombok in Spring Boot Applications


Before delving into the specific issue, it’s worth noting why I, like many other developers, initially considered using Lombok in my Spring Boot application. The benefits of Lombok are well-known within the developer community:

- Reduced Boilerplate Code: Lombok automates the generation of commonly used methods.  

- Cleaner Code: By removing redundant lines of code, Lombok allows developers to focus on the core logic of their application. This not only improves readability but also reduces the potential for human error in writing boilerplate code.  

- Increased Productivity: Writing and maintaining code with Lombok makes developers more productive, as they don’t have to spend time on tasks that are considered trivial but time-consuming.  

- Integration with Spring Boot: Lombok works seamlessly with Spring Boot  

 

For all these reasons, Lombok is widely adopted by Java developers, especially those working with frameworks like Spring Boot.  

The Challenge: Java 23 Compatibility


In my case, the decision to delay Lombok integration into my project for two months stemmed from the fact that Java 23, the latest release at the time, was not officially supported by Lombok. Java 23 was released with several new features and updates that impacted how Java code is compiled and run. However, Lombok, as of the time of my initial work with Java 23, did not officially support this version.


The main issue was related to JEP 442: Foreign Function & Memory API (Incubator), which introduced significant changes in the Java language and runtime. While the Java community was excited about the new features introduced in Java 23, Lombok developers needed time to update their library to work with these changes. Unfortunately, Lombok wasn’t immediately compatible with Java 23, which meant that attempts to use Lombok in a Java 23 environment led to compilation errors, broken builds, or runtime issues. 


Java 21 Compatibility and the Minimum Lombok Version Required    


To further elaborate, Lombok version 1.18.30 was the minimum required version for Java 21, which was another challenge I faced. When working with Java 21 (or any version prior to Java 23), Lombok needed to be updated to a specific version to ensure compatibility. At the time, I was working with Java 21 and had realized that I needed to update my Lombok version to 1.18.30 at the very least to avoid issues related to unsupported features in older versions of the library.


When working with Spring Boot and Java, many developers prefer to use the latest versions of both the Java Runtime Environment (JRE) and Lombok to take advantage of the most recent performance improvements, bug fixes, and features. However, I found myself in a situation where this was not feasible, and I had to prioritize stability and compatibility in my development environment. For this reason, I refrained from using Lombok for two months until a new release of Lombok was made that would support the latest Java version I was using.    

Temporary Workaround: Manual Boilerplate


While I awaited an update to Lombok that would support Java 23, I had to temporarily revert to manually writing the boilerplate code that Lombok typically handles.


Writing this boilerplate code manually gave me a deeper appreciation for the work Lombok does behind the scenes. While it wasn’t as efficient as using Lombok annotations, it helped me maintain a consistent development workflow and ensure that my code would be compatible with the tools available to me at the time.


Why I Eventually Started Using Lombok Again 


After about two months, Lombok officially released a version that supported Java 23. The update addressed the changes introduced in Java 23 and included the necessary adjustments to ensure smooth integration with the language’s new features. Lombok version 1.18.24 and later versions included fixes and improvements that made Lombok fully compatible with Java 23, and that was when I resumed using Lombok in my project. 


Once I updated my Lombok dependency to the latest version, I was able to take advantage of all the benefits of Lombok once again. The time and effort I spent writing boilerplate code were now completely unnecessary, and my application could once again benefit from the clean, concise code that Lombok enables. 

Why I Chose Not to Use Lombok Initially


In conclusion, my decision not to use Lombok in my Spring Boot application for two months was driven by the compatibility issues between Lombok and the latest Java version (Java 23). While Lombok is a powerful tool for reducing boilerplate code, I had to temporarily delay its use until the library was updated to support Java 23. This experience taught me the importance of ensuring compatibility between the libraries and frameworks you use in your application, especially when working with cutting-edge technologies.


Although it was frustrating to temporarily abandon Lombok’s convenience, this decision ultimately ensured that my Spring Boot application remained stable and functional. The delay also reinforced my understanding of the importance of maintaining up-to-date dependencies and how external libraries, such as Lombok, can sometimes lag behind the latest versions of the languages they are designed to support. Now that Lombok has released a version compatible with Java 23, I’m able to continue using it to simplify my code and improve productivity. 


In the fast-evolving world of Java development, it’s crucial to keep track of updates and compatibility between the tools you use. While Lombok’s benefits are undeniable, sometimes technical constraints, such as Java version compatibility, can require temporary workarounds. It’s a reminder that flexibility, patience, and proactive dependency management are key to successful development practices.     

Tags:

Java Lombok Spring boot Java 23 Java 17 Project

Add a Comment

Comments (0):

If you enjoyed this article

You'll probably appreciate these related reads as well.