i guess you are using a new eclipse version. Unfortunately eclipse trolled hard on that part, jdk8 is an LTS version not supported by new ides. Go to eclipse website and download like 2021 version or something.
Open eclipse -> window -> preferences -> java -> installed jres -> add openjdk if you didn't already.
then right click to project -> properties -> java build path -> double click JRE System Library -> change to open JDK.
then right click to build.xml -> run as -> external tools configurations -> JRE tab -> Separate JRE -> select the openjdk one -> apply -> run.
Also make sure that your JAVA_HOME environment variable points to the openjdk bin path