JVM crash when using JTable

吃可爱长大的小学妹 提交于 2019-12-13 02:21:30

问题


I have an industrial PC with an Intel Atom D2550 1.86 GHz CPU, its embedded graphics adapter and 4 Gb RAM running Windows 7 (32 bit) and when I run a Java program on this computer I get a Java(TM) Platform SE binary has stopped working (Problem Event Name BEX and Fault Module Name StackHash_2264).

I have tried both Java8 and Java7 with the same results. I have tried with both just JRE installed, and with a full JDK installed on this machine.

The same Java applicaton works well on this PC if I use Ubuntu 14.10 instead.

A small Hello World application works well, and using a lot of trial and error I could determine that the error occurs when I use a JTable with content. Using a JTable without content is ok though.

This application works:

import javax.swing.*;
import java.awt.*;

public class Test {
    public static void main(String[] args) {
        JFrame f = new JFrame();
        f.setLayout(new BorderLayout());
        f.add(new JScrollPane(new JTable(), BorderLayout.CENTER);
        f.pack();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    }
}

And this application causes the JVM crash:

import javax.swing.*;
import java.awt.*;

public class Test {
    public static void main(String[] args) {
        JFrame f = new JFrame();
        f.setLayout(new BorderLayout());
        f.add(new JScrollPane(new JTable(new String[][] { { "1", "2", "3" }, { "1", "2", "3" } }, new String[] {"A", "B", "C" })), BorderLayout.CENTER);
        f.pack();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    }
}

I have Googled a lot on this issue without any success. The only tip I found was to disable DEP for the application causing the error, but Windows won't let me disable DEP for java.exe.

I have more crash dumps if it would help anyone, just let me know what you need.

来源:https://stackoverflow.com/questions/29844086/jvm-crash-when-using-jtable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!