我对linux和Beagle Bone Black还不熟悉,如果有人帮助我解决问题,我的项目会更上一层楼。
我在Netbeans中成功地开发了一个xml阅读器,并对其进行了清理和构建
No protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at java.awt.Window.initGC(Window.java:475)
at java.awt.Window.init(Window.java:495)
at java.awt.Window.<init>(Window.java:537)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:181)
at Testtagreader.TestGUI.<init>(TestGUI.java:30)
at testtagreader.Test_XML_Reader.main(Test_XML_Reader.java:29)
最佳答案
您的项目似乎正在尝试连接到X服务器,但无法连接。您正在运行X服务器吗?如果确定没有,请查看无头模式:
http://www.oracle.com/technetwork/articles/javase/headless-136834.html
否则,如果确实需要x服务器,请使用Xvfb启动虚拟x服务器。
关于java - 在Beagle bone Black中运行jar文件时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38740794/