On 2022-02-08, Jaikiran Pai wrote:

> Hello Earl,

> On 08/02/22 12:59 am, Earl Hood wrote:
>> How exactly does setting the sysprop for only 18 and 19 allow folks to test
>> their stuff?  If Ant currently depends on the security manager to operate,
>> why not set the sysprop regardless, then remove in future when a
>> replacement API exists?

> Java 18 and 19 now throw a runtime exception by default when
> System.setSecurityManager is called at runtime. This behaviour can be
> changed to prevent the exception being thrown and let it behave like
> older versions, by setting the Java system property
> java.security.manager=allow. We (Ant) cannot set it by default to all
> versions of Java because this "allow" value was only introduced in
> Java 12
> https://www.oracle.com/java/technologies/javase/12-relnote-issues.html#JDK-8191053.
>  Ant
> 1.10.x supports using earlier versions than Java 12 (like Java 8), so
> we (Ant) cannot blindly set that value without these Java version
> checks.

I couldn't find what the property does prior to Java 12, so let me add
this for completeness. This is what happens when you set it on Java 8:

Error occurred during initialization of VM
java.lang.InternalError: Could not create SecurityManager: allow
        at sun.misc.Launcher.<init>(Launcher.java:106)
        at sun.misc.Launcher.<clinit>(Launcher.java:54)
        at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1444)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1429)

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to