首页 文章

访问限制:由于对所需库/ opt / java / error的限制,无法访问JFrame类型

提问于
浏览
1

我已经在网上搜索了这个问题,并找到了许多线程,这些线程提供了解决我遇到的问题的解决方案 .

我收到一个Access restrition错误,如下所述:访问限制:由于对所需库的限制而无法访问JFrame类型/opt/java/jdk1.8.0_31/jre/lib/rt.jar

在我的代码中,JFrame和JPanel下面有红线

我做了这些线程所需的但问题尚未解决Access restriction: The constructor Provider() is not accessible due to restriction on required library jdk1.6.0\jre\lib\jsse.jar?

Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar

JFrame Restricted due to restriction on required library

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;


public class WelcomePage extends JFrame {

    private JPanel contentPane;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    WelcomePage frame = new WelcomePage();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the frame.
     */
    public WelcomePage() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 450, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);
    }

}

我正在运行linux Mint 32bit

我的Java版本是:java版“1.8.0_31”Java(TM)SE运行时环境(版本1.8.0_31-b13)Java HotSpot(TM)服务器VM(版本25.31-b07,混合模式)

1 回答

  • 1

    我找到了绕过这个问题的方法,但顺便说一句,这不是一个具体的解决方案 . 它仍然完成了工作 . 由于没有错误,我现在可以编译我的代码 . 该链接中提到了解决方案:

    A workaround to the problem

    打开有关此问题线程的任何更多建议!

相关问题