Eu tenho um arquivo Jar que gostaria de executar no meu servidor. Quando eu corro usando java -jar MyJar.jar
eu recebo este erro:
No protocol specified
Exception in thread "main" java.lang.InternalError: 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(Unknown Source)
at sun.awt.X11GraphicsEnvironment$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.createGE(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.Window.initGC(Unknown Source)
at java.awt.Window.init(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at Dots.main(Dots.java:13)
Pesquisando um pouco, encontrei várias soluções, mas nenhuma delas resolveu meu problema: export DISPLAY=:0
e xhost +
que, infelizmente, retorna
No protocol specified
xhost: unable to open display ":0"
EDIT * Também tentei, java -Djava.awt.headless=true -jar MyJar.jar
mas eu recebo este erro:
Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at Dots.main(Dots.java:13)
Alguma solução?
X11Forwarding
?
X11Forwarding