I had a similar issue to what you do above. Given this is an old post, you've probably sorted this now
In my case, I had Java (JDK) 22 installed. After uninstalling that and installing 17.0.11 (having both installed gives the same error), then running the startserver.bat worked for me.
I managed to get to the EULA section and then start my server correctly- I hope it helps anyone else who may have this issue!