Unable to load JNA native support library Elasticsearch 6.x Unable to load JNA native support library Elasticsearch 6.x elasticsearch elasticsearch

Unable to load JNA native support library Elasticsearch 6.x


  1. Go to /etc/sysconfig/elasticsearch
  2. Add ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp".

    (For newer Elasticsearch, use Djava.io.tmpdir instead of Djna.tmpdir)

  3. Start Elasticsearch using systemctl start elasticsearch or service start elasticsearch.
  4. You can see now tmp folder created inside /var/lib/elasticsearch/.
  5. This folder should have execute permission for elasticsearch user
  6. Check the permission with name i -l /var/lib/elasticsearch
  7. Make sure the permission file have something like below permission

    dr-xr-xr-x root          root          /drwxr-xr-x root          root          vardrwxr-xr-x root          root          libdrwxr-x--- elasticsearch elasticsearch elasticsearch

I hope your issue will be resolved.


I had the same issue on a CentOS7 cPanel server with ElasticSearch 7.8 installed via YUM.As per the answer, I did the following:

  1. Set ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp" in /etc/sysconfig/elasticsearch
  2. mkdir -p /var/lib/elasticsearch/tmp
  3. chown -R elasticsearch.elasticsearch /var/lib/elasticsearch/tmp


Check the permissions on your /tmp/ directory. It must have had noexec.

/tmp needs exec to support JNA. A workaround is to specify a tmp directory in elasticsearch sysconfig file.

Something like export JAVA_OPTS="-Djava.io.tmpdir=$ES_HOME/tmp"

Make sure there is a $ES_HOME/tmp directory and elasticsearch user has write permissions to it.

I had this issue as I was using a hardened OS and also because the default umask is 0027.