X11

在帶有 KDE 的 Archlinux 上以 root 身份啟動 Arduino IDE 失敗

  • November 2, 2014

我需要以 root 身份執行 IDE 才能訪問串列埠。

該命令是封包件夾內的 ./arduino 。

在 Fedora 上這工作正常,但在 Archlinux 上,程序崩潰並顯示以下輸出:

No protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':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 sun.awt.X11.XToolkit.<clinit>(XToolkit.java:123)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:260)
       at java.awt.Toolkit$2.run(Toolkit.java:860)
       at java.awt.Toolkit$2.run(Toolkit.java:855)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
       at processing.core.PApplet.<clinit>(Unknown Source)
       at processing.app.Preferences.save(Preferences.java:747)
       at processing.app.Preferences.init(Preferences.java:250)
       at processing.app.Base.main(Base.java:117)

我猜你正在使用KDE。您需要使用kdesu命令而不是sudo使用 X 的程序。

引用自:https://unix.stackexchange.com/questions/165600