diff --git a/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java b/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java index 92b9e44f892..cd9201a3c22 100644 --- a/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java +++ b/test/jdk/java/lang/SecurityManager/modules/CustomSecurityManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ public class CustomSecurityManagerTest { @Test(dataProvider = "testCases") public void testProvider(List args) throws Throwable { - ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(args); + ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(args); OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder); outputAnalyzer.shouldHaveExitValue(0); } diff --git a/test/jdk/java/lang/System/SecurityManagerWarnings.java b/test/jdk/java/lang/System/SecurityManagerWarnings.java index c3e3e9a8517..6456f69c2f3 100644 --- a/test/jdk/java/lang/System/SecurityManagerWarnings.java +++ b/test/jdk/java/lang/System/SecurityManagerWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ * @library /test/lib */ -import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.JarUtils; @@ -51,6 +50,7 @@ public class SecurityManagerWarnings { }; """); + System.setProperty("test.noclasspath", "true"); String testClasses = System.getProperty("test.classes"); disallowTest(null, testClasses); @@ -131,13 +131,11 @@ public class SecurityManagerWarnings { static OutputAnalyzer run(String prop, String cp) throws Exception { ProcessBuilder pb; if (prop == null) { - pb = new ProcessBuilder( - JDKToolFinder.getJDKTool("java"), + pb = ProcessTools.createTestJavaProcessBuilder( "-cp", cp, "SecurityManagerWarnings", "run"); } else { - pb = new ProcessBuilder( - JDKToolFinder.getJDKTool("java"), + pb = ProcessTools.createTestJavaProcessBuilder( "-cp", cp, "-Djava.security.manager=" + prop, "-Djava.security.policy=policy",