import sun.security.pkcs11 cannot be resolved

Viewed 3193

I'm updating a code from Java8 to Java11 and eclipse is not recognizing these packages:

import sun.security.pkcs11.*; 
import sun.security.pkcs11.wrapper.*;

The error is "The package is not acessible"

But the package is available in JDK

module jdk.crypto.cryptoki {
    // Depends on SunEC provider for EC related functionality
    requires jdk.crypto.ec;

    provides java.security.Provider with sun.security.pkcs11.SunPKCS11; }

I tryed to add this line to maven args without success

<arg>-XDignore.symbol.file</arg>

Any suggestions?

1 Answers

In my case, I switched to JRE instead JDK in the build path.

As far as I know it is because JRE has the security policies.

Related