Index: bin/ant
--- bin/ant.orig	2023-08-16 13:42:27.000000000 +0200
+++ bin/ant	2024-02-04 11:15:35.312431000 +0100
@@ -356,7 +356,7 @@
 fi
 # Execute ant using eval/exec to preserve spaces in paths,
 # java options, and ant args
-ant_sys_opts=
+ant_sys_opts="-Djava.awt.headless=true"
 if [ -n "$CYGHOME" ]; then
   if [ -n "$JIKESPATH" ]; then
     ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
@@ -368,7 +368,7 @@
     ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
   fi
 fi
-ant_exec_command="exec \"\$JAVACMD\" $ANT_OPTS -classpath \"\$LOCALCLASSPATH\" -Dant.home=\"\$ANT_HOME\" -Dant.library.dir=\"\$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"\$CLASSPATH\""
+ant_exec_command="exec \"\$JAVACMD\" $ANT_OPTS -classpath \"\$LOCALCLASSPATH\" -Dant.home=\"\$ANT_HOME\" -Dant.library.dir=\"\$ANT_LIB\" -Dant.jar=\"\$ANT_LIB/ant.jar\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"\$CLASSPATH\""
 if $ant_exec_debug; then
   # using printf to avoid echo line continuation and escape interpretation confusion
   printf "%s\n" "$ant_exec_command $ant_exec_args"
