我在通过 Eclipse 运行 Java 应用程序时遇到问题。单击“运行”后,会出现提示:
“断言失败! 程序:../truetype.c 线路:2133
表达式:字形!= NULL
(请重试调试应用程序 - 必须启用 JIT)”
* 单击“重试”后,提示“javaw.exe 已停止工作”。
我尝试重新启动笔记本电脑,但问题仍然出现。有人知道如何解决吗?提前致谢。
编辑 1: 下面是我尝试运行的代码。
public static void main(String[] args) {
initView();
}
private static void initView() {
final JFrame frame = new JFrame();
frame.setTitle("Testing 101");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JTextField nameTextField = new JTextField();
frame.getContentPane().add(nameTextField);
JButton saveButton = new JButton();
saveButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(frame, "Hello "+nameTextField.getText());
}
});
frame.getContentPane().add(saveButton);
// Display.
frame.pack();
frame.setVisible(true);
}
最佳答案
我认为您的问题与“启用 JIT”无关,可能与您的 java 安装有关
即时调试 - 首先了解 JIT 是什么
如何:启用/禁用即时调试
疑难解答
- 检查你的java安装情况
- 尝试从“命令行”运行 java 程序:java NAME_OF_CLASS_WITH_MAIN
- 检查 eclipse 安装情况
- 尝试从“eclipse”运行其他java程序
关于Java:如何启用JIT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11463694/