gpt4 book ai didi

java - 访问限制: The type JFrame is not accessible due to restriction on required library/opt/java/error

转载 作者:行者123 更新时间:2023-11-30 08:03:05 25 4
gpt4 key购买 nike

我在网上搜索了这个问题,发现许多线程提供了接近我所遇到的问题的解决方案。

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

在我的代码中,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 32 位

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

最佳答案

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

A workaround to the problem

接受有关此问题线程的任何更多建议!

关于java - 访问限制: The type JFrame is not accessible due to restriction on required library/opt/java/error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31589220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com