英文:
Package jdk.internal.jrtfs in both module java.base and module jrt.fs
问题
private JFrame frame;
/**
* 启动应用程序。
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
GUI window = new GUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* 创建应用程序。
*/
public GUI() {
initialize();
}
/**
* 初始化框架的内容。
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
Console:
在启动层初始化期间发生错误
java.lang.LayerInstantiationException: jdk.internal.jrtfs 包在模块 jrt.fs 和模块 java.base 中均存在
我正在尝试使用 WindowBuilder 在 Eclipse 上创建 GUI,但每次运行时都会遇到相同的错误,无法启动我的类以创建 JFrame。
英文:
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
GUI window = new GUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public GUI() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
Console:
Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Package jdk.internal.jrtfs in both module jrt.fs and module java.base
I'm trying to create a GUI on Eclipse using windowbuilder and all the time i run into the same error and i can't launch my class to create a JFrame.
专注分享java语言的经验与见解,让所有开发者获益!
评论