Skip to content

Commit 976bcb1

Browse files
wirthimur47x111
authored andcommitted
with the deprecation of security managers in Java 24, default.policy not necessarily exists any longer
1 parent 1d2991c commit 976bcb1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sdk/mx.sdk/mx_sdk_vm.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,6 @@ def jlink_new_jdk(jdk, dst_jdk_dir, module_dists, ignore_dists,
10261026
module_names = frozenset((m.name for m in modules))
10271027
all_module_names = frozenset(list(jdk_modules.keys())) | module_names
10281028

1029-
# Edit lib/security/default.policy in java.base
1030-
patched_java_base = _patch_default_security_policy(build_dir, jmods_dir, dst_jdk_dir)
1031-
10321029
# Now build the new JDK image with jlink
10331030
jlink = [jdk.javac.replace('javac', 'jlink')]
10341031
jlink_persist = []
@@ -1040,7 +1037,12 @@ def jlink_new_jdk(jdk, dst_jdk_dir, module_dists, ignore_dists,
10401037
jlink.append('--add-modules=' + ','.join(_get_image_root_modules(root_module_names, module_names, jdk_modules.keys(), use_upgrade_module_path)))
10411038
jlink_persist.append('--add-modules=jdk.internal.vm.ci')
10421039

1043-
module_path = patched_java_base + os.pathsep + jmods_dir
1040+
# Edit lib/security/default.policy in java.base if prior to JDK 24.
1041+
# GR-59085 deprecated the security manager in JDK 24 so no policy exists.
1042+
module_path = jmods_dir
1043+
if jdk.javaCompliance < '24':
1044+
patched_java_base = _patch_default_security_policy(build_dir, jmods_dir, dst_jdk_dir)
1045+
module_path = patched_java_base + os.pathsep + jmods_dir
10441046

10451047
class TempJmods:
10461048
"""

0 commit comments

Comments
 (0)