Sample Header Ad - 728x90

WARNING: environment variable DISPLAY is not set (netbeans)

0 votes
0 answers
1492 views
I was trying to install Netbeans in Xubuntu. I had installed Netbeans using Snapd.
sudo snap install netbeans --classic
I was trying to start Netbeans then I got an error which was looking like this
netbeans
>can't find JDK (I completely don't remember the error but I had fixed it) I had solved it this way
$which javac
/usr/bin/javac
netbeans_jdkhome='/usr/bin/javac'
Then when I try to start netbeans again I get the error.
netbeans
/snap/netbeans/50/netbeans/platform/lib/nbexec: WARNING: environment variable DISPLAY is not set
I had quick search in DuckDuckGo. I didn't search in Google for "safety". I couldn't find any related problem in DuckDuckGo. **Note** : I was using Java in Android Studio. But I couldn't find java in my system that's why I had to install it again. sudo apt-get install openjdk-16-jdk-headlessWARNING: environment variable DISPLAY is not set (netbeans) [Sam](https://stackoverflow.com/users/3246362/sam) mentioned in SO that it is X11 related issue. And my question got nothing in SO that's why I had deleted it there and asking it here as Sam mentioned in comment. I had never faced X11 issue earlier that's why I don't have any idea what I should do. [In the thread](https://software.codidact.com/comments/thread/4585#comment-13797) Celtschk said to execute export DISPLAY=:0.0, after executing that I got another issue.
netbeans
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-16-openjdk-amd64/lib/libawt_xawt.so
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2387)
	at java.base/java.lang.Runtime.load0(Runtime.java:746)
	at java.base/java.lang.System.load(System.java:1857)
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
	at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:310)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:280)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2392)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:808)
	at java.base/java.lang.System.loadLibrary(System.java:1893)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:61)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
	at java.desktop/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:58)
	at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:36)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:84)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
	at org.netbeans.core.startup.Main.start(Main.java:228)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
	at java.base/java.lang.Thread.run(Thread.java:831)
I thought I am getting the error cause netbeans couldn't find JDK. So I had executed it again
netbeans_jdkhome='/usr/bin/javac'
although I still get the same error.
Asked by Unknown (1 rep)
Sep 26, 2021, 06:05 AM
Last activity: Sep 26, 2021, 06:12 AM