joseph monaghan
joseph monaghan

Reputation: 1

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.

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.

Upvotes: 0

Views: 1314

Answers (2)

SGuru
SGuru

Reputation: 665

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

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

Upvotes: 2

Dhaval Jotaniya
Dhaval Jotaniya

Reputation: 1201

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

Upvotes: 0

Related Questions