0

重複の可能性:
EXCEPTION_ACCESS_VIOLATION クラッシュの考えられる理由は何ですか?

これは私の以下のプログラムです。他のプログラムは実行できますが、このプログラムは実行できません。教えてください。

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000063c8d840, pid=6000, tid=3304
#
# JRE version: 7.0_04-b22
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0xfd840]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\hs_err_pid6000.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;
public class Preethi {
    protected void initUI() {
        final DefaultTableModel model = new DefaultTableModel(new String[] {
                "Id", "Name", "Desg" }, 0);
        final JTable table = new JTable(model);
        // table.setFillsViewportHeight(true);
        JFrame frame = new JFrame(Preethi.class.getSimpleName());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JScrollPane scrollpane = new JScrollPane(table);
        frame.add(scrollpane, BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);
        Vector vec = new Vector();
        vec.add("1122");
        vec.add("Iraneee");
        vec.add("Dev");
        model.insertRow(0, vec);
        model.setValueAt("1111", 0, 0);
        //model.setValueAt(new Object[]{"1111","Pavan","Developer"}, 0, 0);

    }

    public static void main(String[] args) throws ClassNotFoundException,
            InstantiationException, IllegalAccessException,
            UnsupportedLookAndFeelException {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Preethi().initUI();
            }
        });
    }

}
4

3 に答える 3

0

お使いのプラットフォーム用の Java の最新リリース (現在は Java 7 update 11) にアップグレードしてから、もう一度お試しください。

于 2013-01-21T14:33:40.487 に答える
0

私はこれを見たり、当時遭遇したりしたので、MS Windowsを実行しているようです。発生した可能性のある問題のリンクを次に示します。

http://java.com/en/download/help/exception_access.xml

JVM を更新するか、Linux/Unix ボックスで実行してみてください。

于 2013-01-21T14:47:40.503 に答える
0

あなたのコードは私のマシンで問題なく動作しました。私はJava 6を持っています

ここに画像の説明を入力

于 2013-01-21T14:34:43.200 に答える