# Elasticsearch 2.0 warning: JNA is not available

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320>\
**Category:** Elasticsearch\
**Created:** [October 29, 2015, 11:03pm UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320 "2015-10-29T23:03:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlr](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@karlr](https://discuss.elastic.co/u/karlr)\
**Post date:** [October 29, 2015, 11:03pm UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/1 "2015-10-29T23:03:52Z")

</div>

Hi,

I'm evaluating Elasticsearch for a project and since 2.0 was released just now I thought why not upgrade my installation.  
I have two questions:

Question 1: In my log file, I see the following on startup:

[2015-10-29 23:50:57,024][WARN][bootstrap] cannot check if running as root because JNA is not available  
[2015-10-29 23:50:57,024][WARN][bootstrap] cannot mlockall because JNA is not available  
[2015-10-29 23:50:57,025][WARN][bootstrap] cannot register console handler because JNA is not available

This was not the case before and I had mlockall working in 1.7. I'm not really a java guy, what am I doing wrong? java -version outputs the following:

xyz@localhost:/etc/init.d# java -version  
java version "1.7.0\_80"  
Java(TM) SE Runtime Environment (build 1.7.0\_80-b15)  
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

Question 2: I previously read that the tmpdir has to be executable in order for mlockall to work and this was my experience as well with Elasticsearch 1.7. As far as I know /tmp/ is noexec on Ubuntu by default, or at least in my experience. The solution I found online for this problem was -Djna.tmpdir=/var/elasticsearch\_tmp in the init.d script which appeared to fix my problem as mlockall was working properly. However, I'd really like to not have to edit the init.d script so that upgrades work in a clearner way - is there some way to inject another tmpdir in a better way?

---

<div class="post-metadata">

**Author:** ![rmuir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmuir/32/44949_2.png) [@rmuir](https://discuss.elastic.co/u/rmuir)\
**Post date:** [October 30, 2015, 2:38am UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/2 "2015-10-30T02:38:26Z")

</div>

I think we should just set java.io.tmpdir explicitly and not use the system temp folder: [https://github.com/elastic/elasticsearch/issues/14372](https://github.com/elastic/elasticsearch/issues/14372)

---

<div class="post-metadata">

**Author:** ![karlr](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@karlr](https://discuss.elastic.co/u/karlr)\
**Post date:** [October 30, 2015, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/3 "2015-10-30T08:14:01Z")

</div>

I solved this in my test environment by running:

mount -o remount,exec /tmp

However, my solution for 1.7 which was  
-Djna.tmpdir=/var/elasticsearch\_tmp

does not seem to work on elasticsearch 2.0, even though it is mentioned here: [https://www.elastic.co/guide/en/elasticsearch/reference/2.0/setup-configuration.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/setup-configuration.html)

Even though I had it in my init script, it was still complaining about operation not permitted on /tmp/.

Another thing I noticed is that if elasticsearch.yml cannot be parsed then elasticsearch just refuses to start with absolutely nothing in the error log. That's really annoying. Especially since it is not obvious here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html) that values need to be quoted to work.

---

<div class="post-metadata">

**Author:** ![flaneur](https://avatars.discourse-cdn.com/v4/letter/f/e9c0ed/32.png) [@flaneur](https://discuss.elastic.co/u/flaneur)\
**Post date:** [November 4, 2015, 4:33pm UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/4 "2015-11-04T16:33:24Z")

</div>

I had the same issue and managed to sort that out without remounting /tmp with exec option -- I set

```
ES_JAVA_OPTS="-Djava.io.tmpdir=/var/lib/elasticsearch/tmp"

```

in /etc/sysconfig/elasticsearch. It looks like jna.tmpdir is ignored at all; I tried setting it, as well as java.io.tmpdir in elasticsearch.service file (I'm on systemd), but that stopped working in ES 2.0.

The strange thing is that this works only on my master/data nodes -- if I set this option on client node, it doesn't start at all.

---

<div class="post-metadata">

**Author:** ![mmairs](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mmairs](https://discuss.elastic.co/u/mmairs)\
**Post date:** [August 2, 2016, 11:27pm UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/5 "2016-08-02T23:27:04Z")

</div>

It is much safer not to mount /tmp exec.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:30pm UTC](https://discuss.elastic.co/t/elasticsearch-2-0-warning-jna-is-not-available/33320/6 "2017-07-05T22:30:33Z")

</div>


