From Java 16 onwards the internal elements of JDK are encapsulated by default.
Incase , if you want to access internal elements of JDK without any exception then you can use --add-opens command line.
java --add-opens=java.base/java.security=ALL-UNNAMED ExampleJep396