Netbeans: java.lang.UnsatisfiedLinkError: no splashscreen in java.library.path:

Viewed 7924

I am trying to launch Netbeans but it is not opening. I tried using the command line too. But in command line I got the following error:

java.lang.UnsatisfiedLinkError: no splashscreen in java.library.path: [/usr/java/packages/lib, /usr/lib/x86_64-linux-gnu/jni, /lib/x86_64-linux-gnu, /usr/lib/x86_64-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:806)
    at java.base/java.lang.System.loadLibrary(System.java:1909)
    at java.desktop/java.awt.SplashScreen$1.run(SplashScreen.java:134)
    at java.desktop/java.awt.SplashScreen$1.run(SplashScreen.java:132)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at java.desktop/java.awt.SplashScreen.getSplashScreen(SplashScreen.java:131)
    at org.netbeans.core.startup.Splash.<init>(Splash.java:122)
    at org.netbeans.core.startup.Splash.getInstance(Splash.java:60)
    at org.netbeans.core.startup.Main.start(Main.java:271)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
    at java.base/java.lang.Thread.run(Thread.java:830)
3 Answers

The issue https://github.com/kaikramer/keystore-explorer/issues/130 referred by @Thirumal says that

You probably had the headless jre package (openjdk-X-jre-headless) installed, which only works for Java software that needs no keyboard, mouse or display.

This was my problem, I executed:

apt list --installed | grep jdk

openjdk-11-jdk-headless/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed]
openjdk-11-jre-headless/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed,automatic]

So I've just installed:

sudo apt install openjdk-11-jdk

And:

apt list --installed | grep jdk

openjdk-11-jdk-headless/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed,automatic]
openjdk-11-jdk/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed]
openjdk-11-jre-headless/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed,automatic]
openjdk-11-jre/focal-updates,focal-security,now 11.0.9.1+1-0ubuntu1~20.04 amd64 [installed,automatic]

After this Netbeans started perfectly.

But, I guess I could have just installed the openjdk-11-jre.

Your project is missing a native library. Make sure to include it on launch. I see that you're using linux, then the file is a .so file. Include it with the -Djava.library.path option. So to start a jar you need java -jar -Djava.library.path=path/to/natives myapp.jar

Related