0

I've created an application in java that can be run on Windows in GUI or in command line, and also on Linux in bash. My problem is that when I run it in Linux I get the "No X11 DISPLAY variable was set" which I know comes from the fact that I create some frames in my program, but only if it's run on Windows with GUI.

How can I make this exception not appear while running the program in Linux?

  • I suggest you `export DISPLAY={whaterever your display is}` if it is not set it would appear you don't have X-windows configured correctly. Which X-Server are you using? On windows, I use the free one which comes with Cygwin. – Peter Lawrey Feb 24 '16 at 08:54
  • try `export DISPLAY=:0` – Mandar Feb 24 '16 at 08:58
  • You should check if the server had a GUI connected to it: `boolean canCreateFrames = !GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadless()` – Ferrybig Feb 24 '16 at 09:00
  • I am connecting remote, so I don't have a display. – Andreea Madalina Feb 24 '16 at 09:01
  • I've tried the solutions proposed in the other post. My question in fact is: how can I hide this message when I run the program. It works perfectly, I just want the exception message not to be displayed anymore. – Andreea Madalina Feb 24 '16 at 09:09
  • Clearly what you think of as your Windows-only code is being executed on Linux. Investigate. – user207421 Feb 24 '16 at 09:12

0 Answers0