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.
** at java.awt.Frame.
** at java.awt.Frame.
** at javax.swing.SwingUtilities$SharedOwnerFrame.
** 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转发。
标签:awt,java,遇到,SwingUtilities,swing,JOptionPane,转发,x11,javax 来源: https://www.cnblogs.com/nanfengnan/p/13946942.html