Reputation: 20002
I am trying to run a java utility on a UNIX Server through PuTTY. This JAVA utility launches a GUI. When I run this utility using the following command
./DAVTree.sh
I get the following Error
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation
which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at com.sas.services.webdav.tools.DAVTree.<init>(DAVTree.java:319)
at com.sas.services.webdav.tools.DAVTree.main(DAVTree.java:944)
I searched on the internet for the problem its something called X11 Forwarding
don't know what that is but I followed the suggestions by googling so I created a new session with PuTTY and under
Connection > SSH > X11
checked yes the Enable X11 Forwarding
Now when I run the utility again the error\exception message has changed it now says.
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window
server using 'localhost:10.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(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.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.Window.init(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at com.sas.services.webdav.tools.DAVTree.<init>(DAVTree.java:319)
at com.sas.services.webdav.tools.DAVTree.main(DAVTree.java:944)
Now it says that no DISPLAY variables is set. So I try this
export DISPLAY=kcsclm92:7001
kcsclm:7001 would be my server. After this when I run the utility it gives the same error only with the following difference
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window
server using 'kcsclm92:7001' as the value of the DISPLAY variable.
I was already working in blind after this I have nothing more to try. Please help.
p.s. (for those who know SAS)I have SAS deployment on a UNIX server and I am trying to run the DAVTree Utility.
Upvotes: 0
Views: 2568
Reputation: 32407
You need an X "server" running on your local Windows machine. (Yes, the terminology is confusing). Try http://mobaxterm.mobatek.net/
Note, the correct DISPLAY setting will be created by Putty automatically, so don't change it (localhost:10
sounds about right).
Upvotes: 1