Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compile error after upgrading to Java 7: package sun.security.pkcs11 does not exist

I just upgraded from Java 6 to Java 7 SDK and am now getting the following error in my ant build:

error: package sun.security.pkcs11 does not exist
Provider p = new sun.security.pkcs11.SunPKCS11(is);

I'm running Windows 7 64-bit. I can compile fine if I switch back to Java 6, but that is not an option any longer. I haven't had much luck finding a solution online. Anybody knows how to resolve this issue?

like image 639
wlaem Avatar asked Dec 04 '12 19:12

wlaem


2 Answers

You will have to convert your application to use APIs which are not restricted. The compiler will warn you quite strictly when you have done such a thing -- this is the consequence of proceeding in the face of those warnings.

See Why Developers Should Not Write Programs That Call 'sun' Packages

like image 112
Thorn G Avatar answered Oct 24 '22 14:10

Thorn G


I have faced the same problem and i solve it by installing the 32-bit JDK insteade of 64-bit and sure it will work .

like image 45
Yassering Avatar answered Oct 24 '22 13:10

Yassering