How to Load Jna Native Support Library Elasticsearch 6.X

Unable to load JNA native support library Elasticsearch 6.x

Okay i have find the solution. Apparently my vm memory storage (RAM) was 1 GB - 2 GB, so i increase my VM's RAM capacity to at least 4GB and i reboot the machine. And elastic search started work just fine.

JNA not found. native methods will be disabled. java.lang.ClassNotFoundException: com.sun.jna.Native

I have solved this issue by adding jna jar file.

<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.2</version>
</dependency>

Resource Link:
Org.elasticsearch.bootstrap - JNA not found. native methods will be disabled

Unable to start elasticsearch on centos 7 server

Looks like a permission issue as shown in the error message, doing a fresh installation with a normal user instead of elastic user works fine.

How do I make a target library available to my Java app?

You can set system properties by using the parameter "-D" when you invoke the Java Virtual Machine on the command line:

java -Djna.library.path=<path to your library> MainClass

You can also set this programmatically in your code at your applications's startup when it has been read from e.g. a config file:

System.setProperty("jna.library.path", <path to your library>);

I haven't used JNA myself, so I don't know if it is actually too late for the JVM when you set the value in code. In that case, go with the first option.



Related Topics



Leave a reply



Submit