I'm trying to develop a simple screen in java using JFrame
but in my eclipse it's showing a message in JFrame
.
Access restriction: The construction JFrame (String) is not accessible due to restriction on required library usr / lib / jvm / java-8-openjdk-amd64 / jre / lib / rt.jar
Access restriction: The JFrame type is not accessible due to restriction on required library usr / lib / jvm / java-8-openjdk-amd64 / jre / lib / rt.jar
My eclipse is in Linux Mint 18.3 (Sylvia)
My code:
package view;
import javax.swing.*;
public class TelaInicial {
private void construirJanela(){
JFrame janela = new JFrame("Janela");
janela.setVisible(true);
}
}
My java looks like this:
carlos@carlos /usr/lib/jvm $ java -version
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)