Skip to content

[GR-71974] Compatibility Mode for Native Image.#12756

Open
graalvmbot wants to merge 1 commit intomasterfrom
vj/GR-71974-ni-compatibility-mode
Open

[GR-71974] Compatibility Mode for Native Image.#12756
graalvmbot wants to merge 1 commit intomasterfrom
vj/GR-71974-ni-compatibility-mode

Conversation

@graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Dec 22, 2025

The goal of this mode is to remove native-image implementation-specific behavior: no build-time initialization on classpath, no custom system properties for native image, no substitutions on classpath, no user features, future defaults enabled by default.

It still does not modify the key restrictions of Native Image which are related to dynamic access and run-time class loading.

To get the same behavior as the underlying language it is recommended to use this flag with:

native-image -H:+CompatibilityMode -H:Preserve=all -H:+RuntimeClassLoading App

And to run it with:

./app -Djava.home=<path-to-java-home> -XX:Classpath=<cp> -XX:Modulpath=<module-path> <args>

The Native Build Tools PR that accompanies this one:

graalvm/native-build-tools#822

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 22, 2025
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 5 times, most recently from a2bc06b to 4383cfd Compare December 22, 2025 12:04
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 2 times, most recently from ba3523c to 2b0171b Compare January 7, 2026 11:53
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 2 times, most recently from 3ebb2f0 to e0b2332 Compare January 19, 2026 12:07
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 2 times, most recently from e57aeed to 5bb59bb Compare January 22, 2026 13:12
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 15 times, most recently from 6a60f88 to bcfcda5 Compare February 4, 2026 13:53
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch from bcfcda5 to b2bef6c Compare February 4, 2026 14:13
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch 9 times, most recently from d181fb3 to ee18168 Compare February 16, 2026 16:42
The goal of this mode is to remove native-image implementation-specific behavior: no build-time initialization on classpath, no custom system properties for native image, no substitutions on classpath, no user features, future defaults enabled by default.

It still does not modify the key restrictions of Native Image which are related to dynamic access and run-time class loading.

Also, this mode still does not disable flags such as --features and --initialize-at-build-time from the command line. This will be discussed separately and done in a separate PR.

To get the same behavior as the underlying language it is recommended to use this flag with:

  native-image -H:+CompatibilityMode -H:Preserve=all -H:+RuntimeClassLoading App

And to run it with:

  ./app -Djava.home=<path-to-java-home> -Djava.class.path=<cp> -Djdk.module.path=<module-path>
@graalvmbot graalvmbot force-pushed the vj/GR-71974-ni-compatibility-mode branch from ee18168 to 357d598 Compare February 16, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants