Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – Black Friday 2026 – NPI EA – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

1. Overview

The Eclipse IDE is one of the most common tools for Java application development. It comes with default settings that enable us to build and execute our code right away within the IDE.

However, these default settings are sometimes not sufficient when we try to build using Maven in Eclipse. Consequently, we’ll encounter build errors.

In this quick tutorial, we’ll demonstrate the configuration changes we need to make so that we can build Maven-based Java projects within the IDE.

2. Java Compilation in Eclipse

Before we start, let’s try to understand a little bit about the compilation process in Eclipse.

The Eclipse IDE comes bundled with its own Java compiler called Eclipse Compiler for Java (ECJ). This is an incremental compiler that can compile only the modified files instead of having to always compile the entire application.

This capability makes it possible for code changes that we make through the IDE to be compiled and checked for errors instantaneously as we type.

Due to the usage of Eclipse’s internal Java compiler, we don’t need to have a JDK installed in our system for Eclipse to work.

3. Compiling Maven Projects in Eclipse

The Maven build tool helps us to automate our software build process, and Eclipse comes bundled with Maven as a plugin. However, Maven doesn’t come bundled with any Java compilers. Instead, it expects that we have the JDK installed.

To see what happens when we try to build a Maven project inside Eclipse, assuming that Eclipse has the default settings, let’s open any Maven project in Eclipse.

Then, from the Package Explorer window, let’s right-click on the project folder and then left-click on Run As > 3 Maven build:

RunAs Maven Build

This will trigger the Maven build process. As expected, we’ll get a failure:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
  (default-compile) on project one: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

The error message indicates that Maven is unable to find the Java compiler, which comes only with a JDK and not with a JRE.

4. JDK Configuration in Eclipse

Let’s now fix the Maven build issue in Eclipse.

First, we need to download the latest version of JDK and install it in our system.

After that, let’s add the JDK as a runtime in Eclipse by navigating to Window > Preferences > Java > Installed JREs:

Installed JREs JRE8

We can see that Eclipse already has Java configured. However, this is the JRE and not the JDK so let’s proceed with the next steps.

Now, let’s click on the Add… button to invoke the Add JRE wizard. This will ask us to select the type of JRE.

Here, we’ve selected the default option, Standard VM:

Add JRE Select JRE Type

Clicking on Next will take us to the window where we’ll specify the location of the JRE home as the home directory of our JDK installation.

Following this, the wizard will validate the path and fetch the other details:

Add JRE Enter JDK8 home

We can now click on Finish to close the wizard.

This will bring us back to the Installed JREs window, where we can see our newly added JDK and select it as our runtime in Eclipse:

Installed JREs Added JDK8

Let’s click on Apply and Close to save our changes.

5. Testing the JDK Configuration

Let’s now trigger the Maven build one more time, in the same way as before.

We can see that it’s successful:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

6. Conclusion

In this tutorial, we saw how we could configure Eclipse for Maven builds to work within the IDE.

By doing this one-time configuration, we’re able to leverage the IDE itself for our builds without having to set up Maven externally.

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – Black Friday 2026 – NPI EA – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW