Among the AI tools for legacy Java modernization, Morph by Modelcode (modelcode.ai) works from a plain fact: moving an application to Java 21 is almost never a one-line change. The new runtime drags the framework, the imports, the libraries and years of untested behavior into the same project, so Morph plans that whole move with your architects, delivers it in milestones your reviewers can read, and checks the upgraded application against the one you run today.
The two-minute video above tells the story with a hanging mobile: swap the piece at the top, and everything below it tilts. Here is what usually moves with the Java version, each with Morph by Modelcode's answer:
The framework. Spring Boot 3 runs only on Java 17 or later, so the framework version changes along with the JDK. Morph: the target framework versions go into the plan your architects approve.
The imports. Jakarta EE replaced the javax packages with jakarta ones, so import statements change across the codebase. Morph: every change reaches your team inside a milestone, as a pull request.
The libraries. Old dependencies need releases that run on the new runtime, when anyone still publishes them. Morph: the libraries and patterns you prefer can be written into the Project Spec before any code changes.
The behavior. Code that no test ever covered still has to act exactly as it did. Morph: testing agents record what the running application does, and the upgraded version has to match it.
Why a Java 21 upgrade is never one line
In a Maven or Gradle project, the Java version is a single setting in the build file, and changing it is the easy, visible part. The harder part sits around it. Spring Boot's own migration guide for version 3.0 states that it requires Java 17 or later and no longer supports Java 8. The same guide explains that Jakarta EE now uses jakarta packages instead of javax, that import statements may need updating once the dependencies change, and that older Java EE dependencies must not stay in the build, even transitively.
Then come the libraries nobody has touched in years, and the logic nobody ever described in a test. Tests that engineers write by hand reflect the specification or their own assumptions. A legacy application also does things nobody wrote down, and those behaviors are the ones an upgrade breaks without anyone noticing.
What upgrade tools already automate
Several tools handle the version upgrade itself, and a team should use whichever fits its stack. Listed alphabetically, Morph by Modelcode included:
AWS Transform: its custom transformations include ready-made ones for common scenarios, Java runtime upgrades among them.
GitHub Copilot modernization: Microsoft's tool for Java developers automates complex upgrade steps in Maven and Gradle projects, for upgrades between Java 8 and Java 25, Java 21 included.
Morph by Modelcode: runs the whole migration across one or many repositories, framework upgrades included, under an approved plan, with milestones and behavioral checks.
OpenRewrite: its "Migrate to Java 21" recipe applies the changes commonly needed for Java 21, replaces deprecated APIs where a clear equivalent exists, sets Java 21 in the build files and moves plugins to compatible versions.
Which one fits depends on the job: how large the change is, how many repositories move together, and how much evidence your team needs that the application still behaves the same.
How Morph by Modelcode runs the whole move
Morph splits a Java 21 migration into four steps, and your team keeps the decisions at each one.
Step 1: a plan, approved before any code changes
Once you submit your modernization goals, Morph analyzes the repositories and generates a Project Spec. For a Java move, that document carries the target stack (Java 21 and the framework versions you aim for) and your constraints, for example keeping backward compatibility. Reviewers check the destination technologies, the planned approach, the requirements and the scope, then refine the spec through a chat. The migration does not begin until the spec is explicitly approved.
Step 2: milestones your reviewers merge
The roadmap defines an ordered set of milestones; in a Java upgrade, the JDK can come before the framework. Each milestone reaches your reviewers as one pull request in your usual code review, and you can see what a milestone is expected to cost before any work on it begins.
Step 3: the running application as the reference
Morph sends testing agents into each milestone: they go through the source, launch the application and log the answers its APIs and command-line tools give, while generated browser scripts walk through the user flows. The original and the upgraded application then run side by side and their behavior is compared, with no test written by hand. In Modelcode's terms, this side-by-side check belongs to the High validation level, the deepest of three. Morph ships the integration tests it used to verify each milestone along with the code.
Step 4: checks that accumulate
From the second milestone onward, Morph replays the functional tests collected by every previous milestone, right after the tests of the milestone in progress. Behavior proven early keeps being proven while later work lands. A failed test shows a banner with a link to the review issue created for it, and your team decides where the fix belongs.
The builds and tests themselves take place on Modelcode Hosted or on machines you own (Linux, Windows or macOS), through ModelDaemon, which you install on those hosts and which only connects outward.
What Morph does not cover today
Morph targets backend services, CLI programs and full-stack web applications. Three kinds of projects fall outside it for now: apps built for phones and tablets, desktop programs shipped as thick clients with an installer, and plugins or extensions that live inside a host such as an IDE or a browser. If your Java estate includes a Swing client or an Eclipse plugin, plan another route for those parts.
How to try it on one service
Choose one backend service that is representative of your estate, not the smallest one you own, and give the upgrade a clear target: Java 21, the framework versions you want, and the rules it must respect. Morph Pro costs $0 per seat each month, with 40,000 credits included and $0.01 for each additional credit, and each milestone shows its expected cost before it runs.
FAQ
What are AI tools for legacy Java modernization?
They range from recipes and assistants that automate a version upgrade (OpenRewrite, GitHub Copilot modernization or AWS Transform, for instance) to platforms like Morph by Modelcode that plan, deliver and verify a whole migration across repositories.
Is moving to Java 21 enough to modernize a legacy Java application?
It is the starting point. The version change brings framework upgrades (Spring Boot 3 will not run below Java 17), the move from javax to jakarta in Java EE code, new library versions and behavior that has to be checked even where no test exists. Treat it as a migration: a plan, increments your team reviews, and checks against the running application.
Does Morph replace OpenRewrite or GitHub Copilot?
No. They automate much of the version upgrade and stay useful. Morph is built for the project around it: an approved plan, milestones as pull requests, tests drawn from observed behavior and a regression suite that grows with every milestone.
How to compare tools before a migration is covered in AI Tools for Legacy Code Migration: 4 Questions to Ask Before You Choose; what verification means in practice, in Verifiable AI Code Modernization: What It Means and How It Works.
More on Morph: https://modelcode.ai/?utm_source=substack&utm_medium=blog&utm_campaign=video5_twin

