In addition to what Chetan mentioned in his answer https://stackoverflow.com/a/75015574/3423570
I had to also add some more args
On Java21 + Eclipse:
Add the following in default VM arguments(Window -> Preferences/Settings -> Installed JREs -> select jre -> edit) - all separated by space
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED
--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED
--add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED