<target name="myTask" depends="compile">
<java classname="Main" >
<classpath>
<pathelement location="${classes.dir}"/>
</classpath>
</java>
<echo message="myTask completed"/>
</target>
public class Main {
public static void main(String[] args) {
System.out.println("Main from Java!");
System.exit(0);
}
}
Executing ant myTask
:
Output with JDK 17
[java] Main from Java!
[echo] myTask completed
Output with JDK 18
[java] Main from Java!
The JVM exits with a System.exit()
in JDK 18 but was not doing so in JDK 17. Is there a know change introduced in JDK 18 related to this behavior?
It seems Ant updated its behavior from v 1.10.14 due to SecurityManager's removal in JDK 18.
Source: https://downloads.apache.org/ant/RELEASE-NOTES-1.10.14.html