0

I am new to programming and trying to create a window in java with eclipse and got this error message at runtime.

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.

perror
  • 7,071
  • 16
  • 58
  • 85
  • 3
    This link might help: http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar – Logan Hasbrouck Jun 03 '15 at 19:34

2 Answers2

2

I removed and re-added JRE System Library and it worked for me.

For this task navigation is: Select Project -> BuildPath -> Libraries

SGuru
  • 645
  • 1
  • 11
  • 28
0

For Eclipse, steps are:

  1. goto file menu
  2. new
  3. java project
  4. find written JRE in "use an execution environment JRE" in combobox select JavaSE 1.7
Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
Dhaval Jotaniya
  • 1,193
  • 2
  • 10
  • 19