Skip to content

Commit 8d7d2c8

Browse files
author
Christian Wimmer
committed
[GR-30433] Disallow the deprecated environment variable USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false.
PullRequest: graal/15182
2 parents ae42837 + 56ac22d commit 8d7d2c8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

substratevm/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This changelog summarizes major changes to GraalVM Native Image.
1515
* (GR-45651) Methods, fields and constructors of `Object`, primitive classes and array classes are now registered by default for reflection.
1616
* (GR-45651) The Native Image agent now tracks calls to `ClassLoader.findSystemClass`, `ObjectInputStream.resolveClass` and `Bundles.of`, and registers resource bundles as bundle name-locale pairs.
1717
* (GR-49807) Before this change the function `System#setSecurityManager` was always halting program execution with a VM error. This was inconvenient as the VM error prints an uncomprehensible error message and prevents further continuation of the program. For cases where the program is expected to throw an exception when `System#setSecurityManager` is called, execution on Native Image was not possible. Now, `System#setSecurityManager` throws an `java.lang.UnsupportedOperationException` by default. If the property `java.security.manager` is set to anything but `disallow` at program startup this function will throw a `java.lang.SecurityException` according to the Java spec.
18+
* (GR-30433) Disallow the deprecated environment variable USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false.
1819

1920
## GraalVM for JDK 21 (Internal Version 23.1.0)
2021
* (GR-35746) Lower the default aligned chunk size from 1 MB to 512 KB for the serial and epsilon GCs, reducing memory usage and image size in many cases.

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,16 @@ protected int buildImage(List<String> javaArgs, LinkedHashSet<Path> cp, LinkedHa
16531653
}
16541654
environment.put(ModuleSupport.ENV_VAR_USE_MODULE_SYSTEM, Boolean.toString(config.modulePathBuild));
16551655
if (!config.modulePathBuild) {
1656-
LogUtils.warningDeprecatedEnvironmentVariable(ModuleSupport.ENV_VAR_USE_MODULE_SYSTEM);
1656+
/**
1657+
* The old mode of running the image generator on the class path, which was deprecated
1658+
* in GraalVM 22.2, is no longer allowed. Using the environment variable
1659+
* `USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false` that used to enable the
1660+
* class-path-mode now leads to an early image build error. We really want to report
1661+
* this as an error, because just ignoring the environment variable would most likely
1662+
* lead to obscure image build errors later on.
1663+
*/
1664+
throw showError("Running the image generator on the class path is no longer possible. Setting the environment variable " +
1665+
ModuleSupport.ENV_VAR_USE_MODULE_SYSTEM + "=false is no longer supported.");
16571666
}
16581667

16591668
completeCommandList.addAll(0, environment.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).sorted().toList());

0 commit comments

Comments
 (0)