2

Getting a java.awt.HeadlessException seems to be a pretty common issue and has been discussed in the. following questions:

The solutions suggest to make sure your X11 forwarding is active e.g. by running

ssh -Y

or

ssh -X

checking your DISPLAY variable

echo $DISPLAY
somemachine:10.0

and trying to run gui software like

xclock

Well - after doing all these things successfully I still get

Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Environment:

java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

or

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

This is on Mac OS X El Capitan. Via screen sharing mode the software works.

What could be done to further debug and then fix this issue?

For the time being I'll check what the warning:

Warning: No xauth data; using fake authentication data for X11 forwarding.

might have to do with it.

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
  • do you have X server started on osx machine? ( usually its XQuartz - https://www.xquartz.org/ ) – Andrey Sidorov Jun 19 '17 at 01:52
  • of course xclock test wouldn't work with out this! – Wolfgang Fahl Jun 19 '17 at 17:27
  • `echo $DISPLAY` and `No X11 DISPLAY variable was set` well that's two things that flatly contradict each other. Either your DISPLAY environment variable is not really set, or Java is lying to you (which is possible but not very likely). Please post a full transcript of your ssh session verbatim. – n. m. could be an AI Jun 20 '17 at 11:30

0 Answers0