Skip to content

Windows native launcher should auto-add JDK 9+/25 compatibility args #426

@robertpatrick

Description

@robertpatrick

The Unix/Python launchers detect the Java major version and add required JDK compatibility options automatically. The Windows native launcher does not do this today; it only forwards options supplied through the JAVA_OPTS environment variable.

That means Jython native Windows launcher can be made to work in build/test automation by setting JAVA_OPTS, but users running jython.exe directly on newer JDKs need to know the required flags themselves. Jython should automatically detect the Java version and add the appropriate compatibility flags if they have not already been provided by the user.

JDK 8:

  • no extra compatibility arguments

JDK 9 through JDK 24:

  • --add-opens=java.base/java.io=ALL-UNNAMED

JDK 25 and newer:

  • --add-opens=java.base/java.io=ALL-UNNAMED
  • --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
  • --enable-native-access=ALL-UNNAMED
  • --sun-misc-unsafe-memory-access=allow

Acceptance criteria:

  • jython.exe detects the Java major version.
  • It adds the same compatibility arguments as the script launchers.
  • It does not duplicate an option already supplied through JAVA_OPTS or launcher JVM args native for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions