我正在使用PuTTY与Raspberry Pi建立套接字连接。
我正在开发一个电视记分牌应用程序。
我正在使用WinSCP将这些.sh
文件复制到Raspberry Pi中。
我正在运行脚本./timer.sh
:
#!/bin/bash
java -jar /home/pi/ScoreBoard_app/Timer/Timer.jar
显示错误:
Exception in thread "AWT-EventQueue-0" 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 javax.swing.JFrame.<init>(JFrame.java:224)
at com.javafx.main.Main$1.run(Main.java:816)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
我甚至试图设置DISPLAY=localhost:0.0
它将显示X11服务器无法在“localhost:10.0”上连接的错误。
我也试过了localhost:1.0
,但是我得到的错误是无法连接“localhost:1.0”。
答案 0 :(得分:2)
你的rasperry-pi需要在sshd_config
你需要在你的电脑上运行一个X服务器,Xming是一个很好的开源X服务器
安装并启动Xming后,需要配置putty,将x显示位置设置为localhost:0.0
了解详情,请搜索xming putty rasperry pi