'Unable to run ant task using OpenJDK 8 with the latest Eclipse

Couple of days ago, I upgraded my Eclipse environment to the latest version 2022-03 (4.23.0), and since then I am unable to run my configured Ant tasks that I was previously running without any issues. The popup error that I'm getting is

Error: A JNI error has occurred, please check your installation and try again followed by another popup: A Java exception has occurred

Looking in the Eclipse Error log, it shows Error logged from Ant UI:

java.net.SocketTimeoutException: Accept timed out
    at java.base/sun.nio.ch.NioSocketImpl.timedAccept(NioSocketImpl.java:708)
    at java.base/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:752)
    at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:675)
    at java.base/java.net.ServerSocket.platformImplAccept(ServerSocket.java:641)
    at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:617)
    at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:574)
    at java.base/java.net.ServerSocket.accept(ServerSocket.java:532)
    at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:91)

I re-configured my JDK, reinstalled it, but when it's set to run with OpenJDK8, all my Ant tasks simply won't start to run. If I configure the JDK to the Eclipse built-in plugin (which is JDK 17), the ant tasks are triggering, but since my projects are configured for JDK 8, the task fails to complete.

I found a lot of suggestions, but they were all from 3+ years ago, it seems that noone has reported this issue with the latest Eclipse. Any suggestion is appreciated, since I lost 2 days trying to figure this out. My next step is to try to revert to the previous Eclipse version that I had before (2021-09)

Edit: I tried re-installing Eclipse and setting up my dev environment from scratch. No luck, same error

Edit2: I installed the previous Eclipse version 2021-12 (4.22.0), and things are running fine there, so it's something related to the latest Eclipse version. Since I'm back up and running again, I won't be looking for a solution anymore, but I'll keep an eye for any answers on this question.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source