Ubuntu No X11 DISPLAY variable was set, but this program performed

Ubuntu No X11 DISPLAY variable was set, but this program performed

When you face issues related to the “No X11 display variable” on the ubuntu machine. you may follow the below troubleshooting steps. We can fix X11 forwarding and Xorg no screens found the issue on ubuntu aw well Linux. you might also be facing java.awt.awterror Linux issue.

root@ubuntu:~# ./Apache-NetBeans-11.3-bin-linux-x64.sh 
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
Can`t initialize UI
Running in headless mode
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Exception: java.awt.HeadlessException thrown from the UncaughtExceptionHandler in thread "main"

Check Out: Top 9 rm Useful Command With Examples On Linux

Step 1: If you’re on the main display, then

export DISPLAY=:0.0

or if you’re using csh or tcsh

setenv DISPLAY :0.0
Now the error related to X11 will be gone. 
root@ubuntu:~# ./Apache-NetBeans-11.3-bin-linux-x64.sh 
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
No protocol specified

Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"

Step 2: if you face issues related to Gnome accessibility then follow below commands.

x11 forwarding linux

Check Out: How To Install and Configure MongoDB On Ubuntu

Now you have to uncomment the variables from this file vim /etc/java-8-openjdk/accessibility.properties and the above error would be solved.

assistive_technologies=org.GNOME.Accessibility.AtkWrapper

We can also change it using sudo sed -i -e ‘/^assistive_technologies=/s/^/#/’ /etc/java-*-openjdk/accessibility.properties

We can also install when facing Xorg issues on the ubuntu machine. X11 Server installation.

sudo apt-get install xorg openbox

Check Out: Top 16 SCP Command To Copy Data Remotely In Linux

X11 Client Installation.

sudo apt-get install xauth

You can also set the X11 Forwarding in the ssh configuration file. 

vim /etc/ssh/ssh_config
X11Forwarding Yes

Run ssh -vv to know the problem if any.

Step 3: you can remove the java package using the below command. 

sudo apt remove openjdk-11-jre-headless

Then install it again. 

sudo apt install openjdk-11-jdk

You’re done java.awt.awterror  x11 forwarding linux xorg no screens found

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment