I'm trying to make a simple code that is:
import javax.swing.*;
public class Example {
public static void main(String[] args) {
JFrame frame = new JFrame();
}
}
but in the line in which I instance the JFrame
it gives to me an error:
Access restriction: The type JFrame is not accessible due to restriction on required library C:\Program Files (x86)\Java\jre1.8.0_45\lib\rt.jar
I tried removing my JRE System Library
of my project and adding it again but it didn't solve my problem. I saw this solution here: Access restriction on class due to restriction on required library rt.jar?
What should I do?
Thanks in advance!