Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-

Tags:

exception

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630) at java.base/java.lang.Runtime.load0(Runtime.java:768)`

like image 637
Akshay Kala Avatar asked Jun 03 '21 15:06

Akshay Kala


People also ask

What is unsatisfiedlinkerror in Java?

The UnsatisfiedLinkError error is a subclass of the java.lang.LinkageError class which means this error is captured at program startup, during the JVM’s class loading and linking process.

How does Java load native libraries at runtime?

Java loads native libraries at runtime by invoking the System.load () or the System.loadLibrary () method. The main difference between the two is that the latter doesn’t require the absolute path and file extension of the library to be specified—it relies on the java.library.path system property instead.

Why do I get the JVM error when declaring a native method?

More specifically, this error is thrown whenever the JVM is unable to find an appropriate native-language definition of a method declared native, while attempting to resolve the native libraries at runtime [ 2 ].


1 Answers

 sudo apt install openjdk-11-jdk

Seems you have only headless package installed (openjdk-11-headless).

like image 199
Dmitry Kochkin Avatar answered Oct 12 '22 09:10

Dmitry Kochkin