简体   繁体   English

对库Java库的访问限制

[英]Access restriction on library Java library

I am new to programming and trying to create a window in java with eclipse and got this error message at runtime. 我是编程和尝试在Java中使用eclipse创建窗口的新手,并且在运行时收到此错误消息。

How do I fix this error or allow access to the Library? 如何解决此错误或允许访问库?

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
Access restriction: The type JFrame is not accessible due to restriction on required library C:\Program Files\Java\jre1.8.0_25\lib\rt.jar

Your help would be greatly appreciated. 您的帮助将不胜感激。

I removed and re-added JRE System Library and it worked for me. 我删除并重新添加了JRE系统库,它对我有用。

For this task navigation is: Select Project -> BuildPath -> Libraries 对于此任务,导航为:选择项目-> BuildPath->库。

For Eclipse, steps are: 对于Eclipse,步骤如下:

  1. goto file menu 转到文件菜单
  2. new
  3. java project Java项目
  4. find written JRE in "use an execution environment JRE" in combobox select JavaSE 1.7 在组合框中的“使用执行环境JRE”中找到书面的JRE,然后选择JavaSE 1.7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于对所需库的限制而对类进行访问限制 - Access restriction on class due to restriction on required library 访问限制:由于必需的库/ opt / java /错误而导致无法访问JFrame类型 - Access restriction: The type JFrame is not accessible due to restriction on required library /opt/java/ error 由于对所需库 rt.jar 的限制而导致对类的访问限制? - Access restriction on class due to restriction on required library rt.jar? JavaMail库上的限制错误 - Restriction error on JavaMail library 无法访问 Java 库 - Cannot access Java library 使用 VS Code 编译 Java,得到“对所需库的限制”错误消息 - Compiling Java with VS Code, getting "restriction on required library" error message 由于对必需的库javax.servlet.jar的限制,对类的访问限制 - Access restriction on class due to restriction on required library javax.servlet.jar 访问限制:由于对所需库的限制而无法访问.. \ jre \ lib \ rt.jar - Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar 访问限制:“应用程序”类型不是 API(对所需库 rt.jar 的限制) - Access restriction: The type 'Application' is not API (restriction on required library rt.jar) 访问限制:类型“ Response”不是API(对所需库/javax.ws.rs-api-2.0.jar的限制 - Access restriction: The type 'Response' is not API (restriction on required library /javax.ws.rs-api-2.0.jar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM