cant run gedit (and arduino) with sudo - cannot open display [closed]

asked 2018-12-05 12:04:22 -0600

noammo gravatar image

Hello, I tried to run gedit and arduino with sudo but it gives me that error

gedit

No protocol specified
Unable to init server: Could not connect: Connection refused

(gedit:1993): Gtk-WARNING **: 19:58:32.712: cannot open display: :0

arduino

No protocol specified
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:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
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 java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
at java.awt.SystemColor.<clinit>(SystemColor.java:465)
at processing.app.Theme.init(Theme.java:84)
at processing.app.Base.<init>(Base.java:210)
at processing.app.Base.main(Base.java:135)

I tried to search about it and I found a few answers, like to login with gnome on xorg, but when I tried it it didnt work is there something else that i can try ?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by hhlp
close date 2018-12-05 12:20:41.852674

Comments

how is your OS system...? Fedora 29S KDE easily install and good run in my system but it's a need to instlall and upgread Arduino IDE library... but Gtk-Warning...it's a problem with a X-windows Crash like a Xorg..server Down...status. plz. check your Xorg or install driver xorg and xorg something to extend System and driver and library. written by simmon

simmon gravatar imagesimmon ( 2018-12-05 13:52:41 -0600 )edit