在模块 java.base 和模块 jrt.fs 中都存在包 jdk.internal.jrtfs。

huangapple 未分类评论71阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年8月15日 02:43:17
  • 转载请务必保留本文链接:https://java.coder-hub.com/63418423.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定