This is done with JavaScrupt interpreter shell of GraalVM CE 21.3.0.
Attempting to access some Java class, such as java.io.File
results in this error:
TypeError: Access to host class java.io.File is not allowed or does not exist.
When running the shell without any options this much is needed to get the error:
new java.io.File()
When running the shell with --js.java-package-globals=false
only this much is required:
Java.type("java.io.File")
How do I fix this problem? If these features are supposed to be provided, then why aren't they working right out of the box?