(Error) The type AESKeyGenerator is not accessible due to restriction on required library.

error for 'Access restriction: The type AESKeyGenerator is not accessible due to restriction on required library D:\Programles\Java\jdk1.6.0_43\jre\lib\ext\sunjce_provider.jar'

when running the segment code 

1 com.sun.crypto.provider.AESKeyGenerator.class.getClassLoader().getClass().getName();

in the eclipse 4.3.2.

solution:

  1. Open the 'JRE System Libraries' tab of the 'Build Path' project property window.
  2. Select the 'Config Build Path...'.
  3. Select "Access rules" of the 'JRE System Libraries' and hit the Edit button.
  4. Click the Add button in the resulting dialog.
  5. For the new access rule, set the resolution to Accessible and the pattern to "com.sun.crypto.provider/**".

that would solves the problem.

 

ref:

Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar

你可能感兴趣的:(generator)