For Java 18+, Ant will no longer use the SecurityManager

Starting Java 18, setting SecurityManager at runtime is disallowed by default https://bugs.openjdk.org/browse/JDK-8270380 in preparation of deprecation (for removal)
of the SecurityManager (https://openjdk.org/jeps/411). Ant (by default) internally used to create and set a SecurityManager. Among other things, one primary reason
was to intercept a call to System.exit() in a JVM within which the Ant process is running. Ant (through) its custom SecurityManager would then prevent the call to
System.exit() and instead throw a specific exception type that the Ant process knew how to handle. This is no longer feasible in Java 18+ and trying to allow usage
of SecurityManager in such Java runtime versions is neither easy nor adding any value. Ant did a release (1.10.13) which attempted to keep around the SecurityManager
usage for a few releases, by introducing some brittle and complex changes, but that is no longer feasible to maintain due to various other issues that it ended up
creating (that have been tracked in the Ant bugzilla).

This commit also skips some tests for Java 18+, those which required usage or testing of the SecurityManager
7 files changed