我试图通过Putty运行一个jar文件,这是通过Amazon Web Server上传的。我试图将编译器合规性级别从1.8更改为1.7。我收到错误:
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:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:174)
at Smiley.<init>(Smiley.java:10)
at Main.main(Main.java:5)
I've enabled X11 forwarding in Putty
当我从桌面运行时,jar文件工作正常。
答案 0 :(得分:1)
您需要确保AWS服务器上安装了一些基本的X11软件包。特别是,您需要xhost
和xorg-x11-xauth
计划。使用Amazon Linux,安装xorg-x11-server-utils
和Uncaught Error: Actions must be plain objects. Use custom middleware for async actions.
软件包。