[jdk8u-dev] RFR: 8288483: JAVA_TOOL_OPTIONS are silently truncated if they exceed 1024 bytes

Dmitry Samersoff dsamersoff at openjdk.java.net
Wed Jun 15 17:41:55 UTC 2022


The JAVA_TOOL_OPTIONS environment variable is used to pass additional JVM arguments.

The current implementation in jdk8 has an internal limit on the length of the option variable (1024 bytes) and the number of options (64).

A longer variable will be silently truncated and some options will be lost or the VM will exist with an unrecognized option error.

The fix is not a direct backport of the changes in the later JDKs, but I kept the code as close as possible to what we have in the latest jdk.

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

Commit messages:
 - 8288483: JAVA_TOOL_OPTIONS are silently truncated if they exceed 1024 bytes

Changes: https://git.openjdk.org/jdk8u-dev/pull/74/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=74&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288483
  Stats: 111 lines in 2 files changed: 50 ins; 16 del; 45 mod
  Patch: https://git.openjdk.org/jdk8u-dev/pull/74.diff
  Fetch: git fetch https://git.openjdk.org/jdk8u-dev pull/74/head:pull/74

PR: https://git.openjdk.org/jdk8u-dev/pull/74


More information about the jdk8u-dev mailing list