sun.misc.BASE64Encoder reported an error that the jar package could not be found

1. Right-click on the project-"Properties-"java bulid path-"jre System Library-"access rules-"resolution select accessible, fill in ** below and click OK! ! !

2.

When writing Java code in MyEclipse, BASE64Decoder is used, import sun.misc.BASE64Decoder; but Eclipse prompts:
Access restriction: The type BASE64Decoder is not accessible due to restriction on required library C:\Program
files\java\jre6\ lib\rt.jar
Access restriction : The constructor BASE64Decoder() is not accessible due to restriction on required library C:\Program files\java\jre6\lib\rt.jar

Solution 1 (recommended):
only required in the project build path First remove the JRE System Library, and then add the library JRE System Library. After recompiling, everything is normal.
Solution 2:
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings ->
Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326904606&siteId=291194637