Tutorial 9 (March 15)
Problem importing javax.swing.JFrame?
Access restriction: The type JFrame is not accessible due to restriction on required library C:\Program Files\Java\jdk1.x.x_xx\jre\lib\rt.jar
If you are using a lab computer at school, and you're getting the above error, try this:
- In your project explorer, right-click your project folder and select Properties.
- Under Java Build Path, you will see the "Source/Projects/Libraries/Order and Export" tabs. Select the Libraries tab.
- Select and remove any existing entries in the list: something like this > JRE System Library [CDC-1.0/Foundation-1.0 (jre1.8.0_71)].
- Click the "Add Library..." button, select JRE System Library.
- In the new window, choose Execution environment.
- In the drop-down menu for Execution environment, select JavaSE-1.7(jre1.8.0_71).
- Click Finish