Answering my own question : I just had to add a jvm.options file with the following content:
--add-opens=java.base/java.lang=ALL-UNNAMED
Edit: typo