1
I’m trying to develop a simple java screen using JFrame
but in my eclipse is showing a message on 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 type Jframe is not accessible due to Restriction on required library usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar
My eclipse is on 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 is 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)
You made sure you have JRE on the same architecture as the eclipse?
– user28595
installed by apt-get install eclipse
– adventistaam
Try this: https://stackoverflow.com/a/2174607/5524514
– user28595
It worked! Thank you very much! You can add reply
– adventistaam
You can answer, since the solution was not mine, but Soen’s :D
– user28595