x11转发遇到的问题

[root@iz2ze9zb2kkp58bej6qsbez tmp]# java A
Exception in thread "main" java.awt.HeadlessException: **
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
** at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)

** at java.awt.Window.(Window.java:536)**
** at java.awt.Frame.(Frame.java:420)**
** at java.awt.Frame.(Frame.java:385)**
** at javax.swing.SwingUtilities$SharedOwnerFrame.(SwingUtilities.java:1763)**
** at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1838)**
** at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696)**
** at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)**
** at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:666)**
** at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:637)**
** at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:608)**
** at A.main(A.java:5)**
问题解决办法,在xshell里面打开x11转发。

上一篇:java-选择文件的简单方法


下一篇:java-如何在不触发侦听器的情况下从PropertyChangeListener更改JOptionPane的值?