I'm trying to use jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11 in IntelliJ, but for some reason it keeps throwing errors. It seems like it's unable to detect this package. One of the solutions was to add --add-exports jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED in the settings, which I did, but now it throws a compile time error in the IDE:
Error:(5, 20) java: package sun.security.pkcs11 is not visible
(package sun.security.pkcs11 is declared in module jdk.crypto.cryptoki, which is not in the module graph)
I'm using Java 11. It works fine when I try to compile and run it over the terminal