• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (2)

1 782W_Amsis_Bamsis commented Permalink

I have such problem with JOptionPane in my website. The error message in web browser:
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:150)
at java.awt.Window.<init>(Window.java:311)
at java.awt.Frame.<init>(Frame.java:431)
at java.awt.Frame.<init>(Frame.java:396)

My server used FreeBSD (without GUI), Tomcat 7 and OpenJDK 1.7. I made all tests with my website on Windows 7 client computer (not on server).
Why do I get these error messages? If I get these messages on my server (FreeBSD without GUI) then I understand problem, but I get error messages in web browser on Windows 7 client computer.
Also, I tried your command "-Djava.awt.headless=true" on FreeBSD server:
java -Djava.awt.headless=true
This didn't solve my problem.
How to solve problem with JOptionPane? Do you have any ideas. Thanks.</init></init></init>

2 Priyanka_JTC commented Permalink

Hi ,
If the command line option -Djava.awt.headless=true is set , then it will tell the AWT package that X11 server is headless (without any display) ,and the java.awt.HeadlessException
will be thrown is any of the heavyweight awt components are being run in such headless env.

The code which is shown in the stacktrace pasted by you is running on the on the server or the web client side ?

Add a Comment Add a Comment