# Elasticsearch 7.13.2 linux(centos) service - Custom JVM - Doesn't start

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668>\
**Category:** Elasticsearch\
**Created:** [July 2, 2021, 4:13pm UTC](https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668 "2021-07-02T16:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajnish\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajnish_kumar/32/80029_2.png) [@Rajnish\_Kumar](https://discuss.elastic.co/u/Rajnish_Kumar)\
**Post date:** [July 2, 2021, 4:13pm UTC](https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668/1 "2021-07-02T16:13:33Z")

</div>

It's installed as a linux service. It comes up and works fine using the bundled jdk(16).

```auto
[tsadmin@tsmkmslin04 ~]$ curl -XGET 'http://localhost:9200'
{
  "name" : "tsmkmslin04",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "MKY32C_DQxmTyU8Xfh7U9A",
  "version" : {
    "number" : "7.13.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "4d960a0733be83dd2543ca018aa4ddc42e956800",
    "build_date" : "2021-06-10T21:01:55.251515791Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

I change the ES\_JAVA\_HOME to any other jdk including jdk-16 or jdk-11 by editing /etc/sysconfig/elasticsearch file. Then it fails to come with below error :-

```auto
-- Unit elasticsearch.service has begun starting up.
Jul 02 15:54:46 tsmkmslin04 systemd-entrypoint[105988]: could not find java in ES_JAVA_HOME at /home/tsadmin/rajnish_openjdk11/jdk-16.0.1/bin/java
Jul 02 15:54:46 tsmkmslin04 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 02 15:54:46 tsmkmslin04 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 02 15:54:46 tsmkmslin04 systemd[1]: Failed to start Elasticsearch.

```

I have tried this with jdk-11 and with jdk-16. It's a valid path.

```auto
[tsadmin@tsmkmslin04 elasticsearch]$ /home/tsadmin/rajnish_openjdk11/jdk-16.0.1/bin/java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
[tsadmin@tsmkmslin04 elasticsearch]$ 

```

I am not able to figure out at all what's going wrong. Any help us appreciated.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 2, 2021, 8:35pm UTC](https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668/2 "2021-07-02T20:35:02Z")

</div>

1. have you tried pointing it at the home directory not the bin directory?

`/home/tsadmin/rajnish_openjdk11/jdk-16.0.1`

1. Also when you start elasticsearch as a service it starts as the `elasticsearch` user so it would need access / permissions to that path as well

---

<div class="post-metadata">

**Author:** ![Rajnish\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajnish_kumar/32/80029_2.png) [@Rajnish\_Kumar](https://discuss.elastic.co/u/Rajnish_Kumar)\
**Post date:** [July 3, 2021, 2:56pm UTC](https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668/3 "2021-07-03T14:56:49Z")

</div>

1. This is how the changes look.  
ES\_JAVA\_HOME=/home/tsadmin/rajnish\_openjdk11/jdk-16.0.1  
From here elasticsearch automatically looks up for java in ES\_JAVA\_HOME/bin directory.

2. This is how the permission on jdk looks like  
You correctly pointed out. This was the reason. Thanks.

---

<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 31, 2021, 2:57pm UTC](https://discuss.elastic.co/t/elasticsearch-7-13-2-linux-centos-service-custom-jvm-doesnt-start/277668/4 "2021-07-31T14:57:42Z")

</div>

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