Android问题:Java基础问题Access restriction: The type JOptionPane is not accessible due to restriction……

Access restriction:
 The type JOptionPane is not accessible due to restriction on required library C:\Program Files\Java\jre1.8.0_25\lib\rt.jar
所需要的类库由于受限制无法访问JOPtionPane。
所以,需要给予一定的权限:
Eclipse->project->properties->Java Build Path->Libraries->Java System Libraries->Access rules下:
如果有javax/swing/JOptionPane直接勾选,如果没有:
点击右边的Edit,弹出Type Access Rules:
Add:选择Accessiable,在rule pattern中键入:

javax/swing/JOptionPane,(一定要注意这个格式,另外这个弹出的Type Access Type对话框下面有提示可以看一下)

然后一路点击OK就可以了。

你可能感兴趣的:(Android问题:Java基础问题Access restriction: The type JOptionPane is not accessible due to restriction……)