File tree Expand file tree Collapse file tree
buildSrc/src/main/java/org/opensearch/gradle
distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ public void execute(Task t) {
115115 test .jvmArgs ("--illegal-access=warn" );
116116 }
117117 }
118+ if (test .getJavaVersion ().compareTo (JavaVersion .VERSION_17 ) > 0 ) {
119+ test .jvmArgs ("-Djava.security.manager=allow" );
120+ }
118121 }
119122 });
120123 test .getJvmArgumentProviders ().add (nonInputProperties );
Original file line number Diff line number Diff line change @@ -77,12 +77,21 @@ static List<String> systemJvmOptions() {
7777 // log4j 2
7878 "-Dlog4j.shutdownHookEnabled=false" ,
7979 "-Dlog4j2.disable.jmx=true" ,
80-
80+ // security manager
81+ allowSecurityManagerOption (),
8182 javaLocaleProviders ()
8283 )
8384 ).stream ().filter (e -> e .isEmpty () == false ).collect (Collectors .toList ());
8485 }
8586
87+ private static String allowSecurityManagerOption () {
88+ if (Runtime .version ().feature () > 17 ) {
89+ return "-Djava.security.manager=allow" ;
90+ } else {
91+ return "" ;
92+ }
93+ }
94+
8695 private static String maybeShowCodeDetailsInExceptionMessages () {
8796 if (Runtime .version ().feature () >= 14 ) {
8897 return "-XX:+ShowCodeDetailsInExceptionMessages" ;
You can’t perform that action at this time.
0 commit comments