# Unable to start elasticsearch from systemctl in centos 7.7

**URL:** <https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025>\
**Category:** Elasticsearch\
**Created:** [April 27, 2020, 8:15pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025 "2020-04-27T20:15:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gauti](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Gauti](https://discuss.elastic.co/u/Gauti)\
**Post date:** [April 27, 2020, 8:15pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025/1 "2020-04-27T20:15:21Z")

</div>

Hi All,

I have done a fresh installation of elasticsearch 7.6.2, installation went through successfully. Only problem is i'm not able to start the elasticsearch service through systemctl

But i'm able to start the service by going to /us/share/elasticsearch/bin folder and executing elasticsearch file.

Getting some java related error

`java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native`

Any suggetsions please

Thanks  
Gautham

---

<div class="post-metadata">

**Author:** ![Gauti](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Gauti](https://discuss.elastic.co/u/Gauti)\
**Post date:** [April 28, 2020, 9:31am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025/2 "2020-04-28T09:31:13Z")

</div>

Got the answer.

Edit the file `/etc/sysconfig/elasticsearch`

Changing the `ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp"` worked.

Thanks  
Gautham

---

<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:** [May 26, 2020, 9:31am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025/3 "2020-05-26T09:31:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
