diff --git a/kotlin/internal/jvm/impl.bzl b/kotlin/internal/jvm/impl.bzl index 213694620..bfd22aae0 100644 --- a/kotlin/internal/jvm/impl.bzl +++ b/kotlin/internal/jvm/impl.bzl @@ -73,9 +73,10 @@ def _write_launcher_action(ctx, rjars, main_class, jvm_flags): java_bin_path = java_runtime.java_executable_runfiles_path # Following https://github.com/bazelbuild/bazel/blob/6d5b084025a26f2f6d5041f7a9e8d302c590bc80/src/main/starlark/builtins_bzl/bazel/java/bazel_java_binary.bzl#L66-L67 - # Enable the security manager past deprecation. + # Enable the security manager past deprecation until permanently disabled: https://openjdk.org/jeps/486 # On bazel 6, this check isn't possible... - if getattr(java_runtime, "version", 0) >= 17: + _java_runtime_version = getattr(java_runtime, "version", 0) + if _java_runtime_version >= 17 and _java_runtime_version < 24: jvm_flags = jvm_flags + " -Djava.security.manager=allow" if ctx.configuration.coverage_enabled: diff --git a/src/main/starlark/core/compile/cli/compile.bzl b/src/main/starlark/core/compile/cli/compile.bzl index b06413faf..308b8b3a3 100644 --- a/src/main/starlark/core/compile/cli/compile.bzl +++ b/src/main/starlark/core/compile/cli/compile.bzl @@ -70,9 +70,10 @@ def write_jvm_launcher(toolchain_info, actions, path_separator, workspace_prefix java_bin_path = java_runtime.java_executable_runfiles_path # Following https://github.com/bazelbuild/bazel/blob/6d5b084025a26f2f6d5041f7a9e8d302c590bc80/src/main/starlark/builtins_bzl/bazel/java/bazel_java_binary.bzl#L66-L67 - # Enable the security manager past deprecation. + # Enable the security manager past deprecation until permanently disabled: https://openjdk.org/jeps/486 # On bazel 6, this check isn't possible... - if getattr(java_runtime, "version", 0) >= 17: + _java_runtime_version = getattr(java_runtime, "version", 0) + if _java_runtime_version >= 17 and _java_runtime_version < 24: jvm_flags = jvm_flags + " -Djava.security.manager=allow" classpath = path_separator.join(