Java,AWTUtilities,eclipse报编译错误:Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')
【场景】调用com.sun.awt.AWTUtilities时,eclipse提示编译错误:
Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')
【分析】eclipse项目默认的jre版本较早。
com.sun.awt.AWTUtilities是在JDK 6 update10中增加的。
【解决】更换JRE
方案一:为eclipse更换默认JRE
方案二:为项目更换JRE
1、项目上右击,快捷菜单,Build Path -> Configure Build Path...
2、列表树中选中Java Build Path,选项页中选中Libraries页
3、选中JRE项,Remove
4、Add Library
5、选中JRE System Library,Next
6、选中Alternate JRE,下拉列表中选择您的JRE,Finish
7、OK
Java,AWTUtilities,eclipse报编译错误:Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')的更多相关文章
- Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar 报错
报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...
- Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入. ===== ...
- Eclipse 编译错误 Access restriction: The type 'JPEGCodec' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')
解决方案: Project -> Properties ->Java Build Path -> libraries, 先 remove 掉 JRE ...
- Access restriction: The type BASE64Encoder is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
解决方案:在configure build path 中去掉 jre system library,然后重新加载jre system library.....
- 关于Access restriction: The type 'Application' is not API (restriction on required library)
原文链接:http://rxxluowei.iteye.com/blog/671893 今天写第一次写JavaFX的入门程序就GG 遇到了导入API的问题,无奈疯狂地通过网络找解决方案.. 我的问题是 ...
- 关于在调用JAVAFX相关包时遇到Access restriction: The type 'Application' is not API (restriction on required library)的解决方法
点击工具栏的Project->Properties->Java Build Path->Libraries-> 双击第一项 点击Add添加允许javafx 然后就不会报错了
- 启动Eclipse时,出现 “Failed to load the JNI shared library "C:\Program Files\java\jdk1.7.....\jvm.dll"
原因1:给定目录下jvm.dll不存在. 解决方法:(1)重新安装jre或者jdk并配置好环境变量. (2)copy一个jvm.dll放在该目录下. 原因2:eclipse的版本与jre或者jdk版本 ...
- 怎么在eclipse中查到这个类用的是哪个jar的类和Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
找到了一个办法,你先按F3,然后点击Change Attached Source..按钮,在弹出的框里有个路径,我的路径是D:/SNFWorkSpace/JAR/~importu9.jar,然后你去引 ...
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...
随机推荐
- 量化交易(Quantitative Trading)
什么是量化交易 量化交易是指借助现代统计学和数学的方法,利用计算机技术来进行交易的证券投资方式.量化交易从庞大的历史数据中海选能带来超额收益的多种“大概率”事件以制定策略,用数量模型验证及固化这些规律 ...
- 廖雪峰Java2面向对象编程-5包和classpath-4classpath和jar
1.classpath 1.1classpath定义 classpath是一个环境变量 classpath指示JVM如何搜索class classpath设置的搜索路径与操作系统相关 * window ...
- Jquery的ajax在IE提交数据乱码解决方法
原文地址:http://fatkun.com/2010/12/jquery-ajax.html 乱码是因为编码不同而造成的.在ajax post 或 get时都有可能出现乱码. 为了避免乱码,可以做到 ...
- Windows和pthread中提供的自旋锁
Windows和POSIX中都提供了自旋锁,我们也可以通过C++11的atomic来实现自旋锁.那么两者性能上面是什么关系?先引入实现代码: #ifndef __spinlock_h__ #defin ...
- i++ 和 ++i的字节码指令
代码 public class Test{ public static void main(String args[]){ int i=0;i=i++; System.out.println(i);} ...
- [UE4]移除UI(User Widget)并销毁
1.移除UI,使用“Remove from Parent”方法 2.最后一步给UI变量赋值的时候,如果保持默认选择“Select Assets”,则会把UI变量销毁(赋值为null).
- Unity打包Android平台AssetBundle脚本
注意,BuildTarget tagetPlatform参数为BuildTarget.Android using UnityEngine; using UnityEditor; public clas ...
- Cloudera HUE大数据可视化分析
下载版本 cdh版本 http://archive-primary.cloudera.com/cdh5/cdh/5/ 我们下载这个 这个是我下载好的 我们解压一下 下载需要的系统包 yum insta ...
- 对KVM虚拟机进行cpu pinning配置的方法
这篇文章主要介绍了对KVM虚拟机进行cpu pinning配置的方法,通过文中的各种virsh命令可进行操作,需要的朋友可以参考下 首先需求了解基本的信息 1 宿主机CPU特性查看 使用virsh n ...
- vue实现点击、滑动右侧字母对应各个城市
1.字母组件给父组件传递当前点击的字母值 @click="handleLetterClick" //绑定事件 handleLetterClick (e) { //向上传递参数 th ...