Language support Java

Move every Java repo to a supported version in one coordinated run.

Java 8 through 25, plus framework migrations, dependency updates, and CVE remediation. One LST engine, one recipe catalog, one PR review process.

Why Java at Moderne

The broadest recipe catalog, on a compiler-accurate model.

Java is the original target of OpenRewrite. Every Java file lands in the Lossless Semantic Tree, and every recipe operates against it.

Compiler-accurate by default.

Recipes run against the LST, not a regex. Symbol resolution, type attribution, comments, and formatting are preserved on every run. Reviewers see the transformation, not whitespace churn.

7,000+ recipes, covering Java first.

Java has the broadest recipe coverage Moderne ships: version upgrades, JUnit migrations, Jakarta namespace shifts, Log4Shell and other CVE patches, framework upgrades, and static-analysis cleanups.

One run across the estate.

Recipe execution coordinates across thousands of Java repos in parallel. Portfolio dashboards show coverage and progress. Per-PR provenance gives auditors a clean trail.

What you can migrate

Concrete Java migration paths.

Every path below is a recipe (or recipe chain) shipped today. Browse the full catalog at docs.moderne.io.

Version upgrade

Java 8 → 11

Language-feature migrations, removed APIs, module-system adjustments, and dependency updates for the 8-to-11 jump.

Version upgrade

Java 11 → 17

Sealed classes, pattern matching, switch expressions, and removed deprecated APIs. Build-tool plugin alignment included.

Version upgrade

Java 17 → 21

Record patterns, virtual threads, and migration off internal JDK APIs. Build files and CI configuration updated alongside source.

Version upgrade

Java 21 → 25

Latest LTS (Sept 2025). Recipes target the API changes and removed previews between 21 and 25.

Framework

javax → jakarta

Jakarta EE namespace migration across imports, dependencies, and APIs. The canonical use case for semantic refactoring at portfolio scale.

Tests

JUnit 4 → JUnit 5

Annotation mapping, lifecycle conversion, assertion rewriting, and Maven or Gradle dependency updates.

Security

Log4Shell and CVE patches

Drop-in remediation for Log4j 1.x and 2.x, plus a catalog of vulnerable dependency replacements with locked-in upgrade targets.

Dependencies

Maven and Gradle hygiene

Manage and upgrade Maven (71 recipes) and Gradle (46 recipes) dependencies across the estate, including transitive resolution.

Quality

Static analysis cleanup

180+ static-analysis rules modeled on the standards your team already uses, applied consistently across every repo.

Our developers now spend less time worrying about legacy code and more time focusing on value-driven work.
Jason Simpson VP of Engineering, Choice Hotels Read the case study

How it works

Three steps, every language.

  1. Ingest the LST.

    Moderne parses every Java file across every repo into a Lossless Semantic Tree. Types, symbols, comments, and formatting are preserved.

  2. Run the recipe.

    Recipes execute against the LST. Transformations are deterministic, format-preserving, and applied identically across every affected file.

  3. Review and merge.

    Reviewable pull requests open across every repo touched. Your team merges. Moderne tracks coverage and progress portfolio-wide.

Questions

Java upgrades, answered.

Java modernization is the process of upgrading Java codebases, libraries, and frameworks to secure, supported versions, and consistently applying best practices (that can be custom to your organization).

The most reliable approach to modernizing Java code is automated Java refactoring. By using semantic transformations instead of manual edits or regex, enterprises can modernize Java code safely while preserving formatting, style, and comments.

Leading organizations use platforms like Moderne to orchestrate migrations across their entire code estate. Instead of upgrading one application at a time, teams can modernize thousands of repositories in parallel with tested, repeatable recipes.

Yes. Moderne was built for multi-repo environments, applying upgrades simultaneously across all repositories to ensure consistency and eliminate code drift.

OpenRewrite provides the recipes that define how to modernize Java code. These recipes capture best practices for version upgrades, security patches, and framework migrations. Moderne scales those recipes across enterprise estates with orchestration, auditability, and collaboration.

Yes. Moderne ensures upgrades are deterministic, testable, and delivered as clean diffs in pull requests. Teams can review and validate changes with confidence before they reach production.

Get started

Modernize Java once. Then keep it that way.

Recipes lock in the upgrade. Future drift gets caught and remediated on the same engine, on the same review workflow.