RFR: 8349254: Disable "best-fit" mapping on Windows environment variables

Jaikiran Pai jpai at openjdk.org
Fri Feb 7 14:45:11 UTC 2025


On Thu, 6 Feb 2025 19:46:21 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> This is a follow-on fix to [JDK-8337506](https://bugs.openjdk.org/browse/JDK-8337506). The Java launcher can take arguments from "JDK_JAVA_OPTIONS" environment variable, so the same processing is needed. Also, obsolete code for Windows 9x has been removed.

In (the Windows specific) `src/java.base/windows/native/libjli/cmdtoargs.c` there's an additional call to lookup (a different) `_JAVA_OPTIONS` environment variable through `getenv()` just to log out that environment variable's value. Should we replace that call to `getenv()` with `winGetEnv()` too?

And on a more general note, should the calls to `getenv()` in the launcher's native code (for example, For example, the `getenv("CLASSPATH")`) be re-examined in context of this issue and have it replaced with this alternative?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23498#issuecomment-2643130961


More information about the core-libs-dev mailing list