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(GraphicsEnvironment.java:159) at java.awt.Window.<init>(Window.java:432) at java.awt.Frame.<init>(Frame.java:403) at javax.swing.JFrame.<init>(JFrame.java:202) at DrawGUI.<init>(DrawGUI.java:15) at ShapeCreator.<init>(ShapeCreator.java:31) at ShapeCreator.main(ShapeCreator.java:138)
What does this error message mean? And how can I solve it?
The DISPLAY environment variable instructs an X client which X server it is to connect to by default. The X display server install itself normally as display number 0 on your local machine. In Putty, the “X display location” box reads localhost:0 by default.
The X11 allows taking GUI access over SSH to any of the LINUX or UNIX systems to run any application/program in GUI. There are few things that needs to be taken care of: 1. Make sure the X11Forwarding is enabled in the ssh_config file.
awt. HeadlessException is a runtime exception in Java that occurs when code that is dependent on a keyboard, display or mouse is called in an environment that does not support a keyboard, display or mouse.
Go to the file . bashrc in your home directory and set the variable, then export it. you can use /etc/bashrc if you want to do it for all the users.
I assume you're trying to tunnel into some unix box.
Make sure X11 forwarding is enabled in your PuTTY settings.
This appears to be a more general SWING/AWT/JDK problem that just the JBOSS installer:
The accepted answer below solved the issue for me :
Unable to run java gui programs with ubuntu
("sudo apt-get install openjdk-6-jdk")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With