JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. As of Java 18, the new API for blocking System.exit is not available yet, see https://bugs.openjdk.java.net/browse/JDK-8199704. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>tags/V1_9_9
<jvm.arg.addOpens>--add-opens java.base/java.lang=ALL-UNNAMED</jvm.arg.addOpens> | <jvm.arg.addOpens>--add-opens java.base/java.lang=ALL-UNNAMED</jvm.arg.addOpens> | ||||
</properties> | </properties> | ||||
</profile> | </profile> | ||||
<profile> | |||||
<id>jdk-18-to-xx</id> | |||||
<activation> | |||||
<jdk>[18,)</jdk> | |||||
</activation> | |||||
<properties> | |||||
<!-- | |||||
JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. | |||||
As of Java 18, the new API for blocking System.exit is not available yet, see | |||||
https://bugs.openjdk.java.net/browse/JDK-8199704. | |||||
--> | |||||
<jvm.arg.addOpens>-Djava.security.manager=allow</jvm.arg.addOpens> | |||||
</properties> | |||||
</profile> | |||||
<profile> | <profile> | ||||
<id>release</id> | <id>release</id> | ||||
<properties> | <properties> |
public static class Spec extends AbstractRunSpec { | public static class Spec extends AbstractRunSpec { | ||||
static { | static { | ||||
try { | try { | ||||
// TODO: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. | |||||
// As of Java 18, the new API for blocking System.exit is not available yet, see | |||||
// https://bugs.openjdk.java.net/browse/JDK-8199704. | |||||
System.setSecurityManager(RunSecurityManager.ME); | System.setSecurityManager(RunSecurityManager.ME); | ||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||
System.err.println("JavaRun: Security manager set - no System.exit() protection"); | System.err.println("JavaRun: Security manager set - no System.exit() protection"); |