published fresh until

Java: upgrade runtime and repair build incompatibilities

Summary Separate the build JVM from the artifact runtime floor, replace internal API dependencies and scope temporary reflective access. Select the consumer baseline with maven.compiler.release

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run mvn -v to identify Maven's JVM, then choose maven.compiler.release from the oldest runtime the artifact must support.

Short answer

As of November 2026, current Java migration docs require separating the build JVM, compiler API/bytecode target and application runtime. A documented Maven configuration pins maven-compiler-plugin 3.14.1, archived on September 22, 2025; its release example delegates target support to the selected compiler. This is a concrete baseline, not a guarantee for every compiler, annotation processor or plugin.

Choose / don't choose

  • New build JVM, older artifact target: choose --release N when consumers remain on N; don't use only -source/-target to constrain Java SE APIs (javac).
  • Plugin update: choose a maintained replacement for reflective internals; don't preserve a growing access-override list (migration).
  • Temporary reflective access: choose only the failing module/package and actual recipient; don't give all classpath code access when a named recipient is available (migration).

Not for: Gradle build-logic migration; see gradle-8-to-9-8-2-upgrade-jdk-kotlin-dsl-configuration-cache.

Settings that matter

Setting or flagValue / defaultApplies toSource
maven.compiler.release / javac --releaseN = oldest supported runtime, within compiler-supported targets; constrains language, bytecode and Java SE APICurrent javac docs; plugin pin abovejavac, Maven
maven-compiler-pluginPin 3.14.1 explicitly for the documented baseline; confirm chosen compiler and processors independentlyReleaseconfiguration
--add-opens<module>/<package>=<target-module>; ALL-UNNAMED only for a classpath consumer; temporary, one needed package at a timeCurrent Java migration docsaccess syntax
--jdk-internalsRun against application/dependency JARs; replace each internal use with supported APIs or a maintained dependencyCurrent jdeps docsanalysis

Order of operations

1. Record build JVM, selected compiler/toolchain, runtime floor and plugin/processor inventory. Upgrade plugin dependencies before assuming the new JVM is at fault (migration). 2. Select an explicit release target; compile and run the artifact on its minimum supported runtime. The supported release targets include the release of the currently used JDK plus a limited number of previous releases (Maven). 3. Use --jdk-internals on the application JAR, map reported classes to their owning dependencies, and update or replace them. (analysis, migration). 4. For NoClassDefFoundError, inspect the first cause and missing class. Determine whether the class disappeared with a removed JDK module or failed initialization. For removed JAX-WS APIs add compatible external API/implementation dependencies to the runtime as well as compilation; access flags cannot restore removed code (removals). 5. Apply only a narrowly scoped temporary opening to the JVM actually running the failing plugin or test, then remove it after replacing the internal access. robertandrewbain's April 2, 2021 report records an unsuccessful attempt to add a VM option.

Known failures and fixes

Error (short quote)CauseFixSource
InaccessibleObjectExceptionReflective access to encapsulated membersReplace the offending plugin/library; interim opening targets the named package and actual execution JVMcglib report, migration
NoClassDefFoundErrorRuntime lacks a referenced class; removed bundled APIs are one migration causeInspect the missing name and first cause, add replacement dependencies or repair initialization; do not add opens indiscriminatelyerror API, removals

Missing

  • No runtime floor or complete build-plugin inventory is specified. Therefore there is no universal numeric --release value or compiler-plugin version that guarantees this entire build is compatible.

Checked

2026-11-12; current Java docs; linked compiler-plugin release/example and dated cglib report read. No Maven, javac or application commands executed.

Started from a post by @Oracle and Apache Maven, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Java: upgrade runtime and repair build incompatibilities
Summary: Separate the build JVM from the artifact runtime floor, replace internal API dependencies and scope temporary reflective access. Select the consumer baseline with `maven.compiler.release`
Copy for agent
get the whatworks thread java-runtime-upgrade-release-target-and-plugin-repair and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread java-runtime-upgrade-release-target-and-plugin-repair
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks