# New Install 8.17 scripts not working - java

**URL:** <https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862>\
**Category:** Elasticsearch\
**Created:** [January 29, 2025, 11:17pm UTC](https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862 "2025-01-29T23:17:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjanzen](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mjanzen](https://discuss.elastic.co/u/mjanzen)\
**Post date:** [January 29, 2025, 11:17pm UTC](https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862/1 "2025-01-29T23:17:09Z")

</div>

New to Elasticsearch.

Working on setting up a proof of concept.

I'm using the tutorial here  
[Tutorial 1: Installing a self-managed Elastic Stack | Elastic Installation and Upgrade Guide [8.17] | Elastic](https://www.elastic.co/guide/en/elastic-stack/current/installing-stack-demo-self.html)

Anytime I try to use any of the scripts located at /usr/share/elasticsearch/bin/

I get an error.

I'm trying to use this command to generate a token  
sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node

The error I get is  
/usr/share/elasticsearch/jdk/bin/java:error while loading shared library: libjli.so: cannot open shared object file: no such file or directory

Also happens when I run the script to change the built in user.

My understanding is that elasticsearch is bundled with Java, so I shouldn't have to do anything with java.

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [January 30, 2025, 11:18am UTC](https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862/2 "2025-01-30T11:18:37Z")

</div>

Hi @mjanzen,

Welcome! This could either be down to a bad Java install (if you are not using the bundled Java) or a file permissions issue. Are you definitely using the bundled install over a local install?

Can you check out the remediation steps for the below issues and see if the recommendations solve your issue?

> <https://github.com/elastic/elasticsearch/issues/84380>
>
> \### Elasticsearch Version
> 
> 8.0
> 
> \### Installed Plugins
> 
> \_No response\_
> 
> \### Java V…ersion
> 
> \_bundled\_
> 
> \### OS Version
> 
> Linux 4.18.0-348.12.2.el8\_5.x86\_64 #1 SMP Mon Jan 17 07:06:06 EST 2022 x86\_64 x86\_64 x86\_64 GNU/Linux
> 
> \### Problem Description
> 
> I am deploying a new ES cluster running 8.0 using RHEL 8.5. Fairly vanilla deployment and Elasticsearch is running on the first node with auto-security used, no JVM installed (using built-in). SELINUX is permissive.
> 
> Elastic is launching using systemd and I am able to query the cluster information:
> 
> \`\`\`
> {
> "name" : "es-mstr-01.corp.nklab.com.au",
> "cluster\_name" : "nkl-prd-es-clr-01",
> "cluster\_uuid" : "zpb0mWSGSVSVvByeZ-fl4w",
> "version" : {
> "number" : "8.0.0",
> "build\_flavor" : "default",
> "build\_type" : "rpm",
> "build\_hash" : "1b6a7ece17463df5ff54a3e1302d825889aa1161",
> "build\_date" : "2022-02-03T16:47:57.507843096Z",
> "build\_snapshot" : false,
> "lucene\_version" : "9.0.0",
> "minimum\_wire\_compatibility\_version" : "7.17.0",
> "minimum\_index\_compatibility\_version" : "7.0.0"
> },
> "tagline" : "You Know, for Search"
> }
> \`\`\`
> 
> When I attempt to run any of the scripts in the bin folder to generate tokens for adding the additional nodes I receive the following:
> 
> \`\`\`
> \[template@es-mstr-01 ~\]$ cd /usr/share/elasticsearch/bin
> \[template@es-mstr-01 bin\]$ sudo ./elasticsearch-create-enrollment-token -s node
> /usr/share/elasticsearch/jdk/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
> \[template@es-mstr-01 bin\]$ ./elasticsearch-create-enrollment-token -s node
> ./elasticsearch-env: line 83: /usr/share/elasticsearch/jdk/bin/java: Operation not permitted
> \`\`\`
> 
> Additionally, the following output can be seen when attempting to locate libjli.so:
> 
> \`\`\`
> \[template@es-mstr-01 bin\]$ locate libjli.so
> /usr/share/elasticsearch/jdk/lib/libjli.so
> \[template@es-mstr-01 bin\]$ sudo ldd /usr/share/elasticsearch/jdk/bin/java
> linux-vdso.so.1 (0x00007ffeb3bf4000)
> libz.so.1 =\> /lib64/libz.so.1 (0x00007f1f7e6bf000)
> libjli.so =\> /usr/share/elasticsearch/jdk/bin/../lib/libjli.so (0x00007f1f7e4ae000)
> libpthread.so.0 =\> /lib64/libpthread.so.0 (0x00007f1f7e28e000)
> libdl.so.2 =\> /lib64/libdl.so.2 (0x00007f1f7e08a000)
> libc.so.6 =\> /lib64/libc.so.6 (0x00007f1f7dcc5000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f1f7ead9000)
> \[template@es-mstr-01 bin\]$
> \`\`\`
> 
> Any ideas would be greatly appreciated. I have also attempted to add the path using ldconfig but this made no difference.
> 
> First lodged in community forums \[here\](https://discuss.elastic.co/t/es-8-0-rpm-install-libjli-so-cannot-be-located-launching-scripts-binaries-from-the-bin-directory-rhel-8/298105)
> 
> 
> 
> \### Steps to Reproduce
> 
> \`\`\`
> \[template@es-mstr-01 ~\]$ cd /usr/share/elasticsearch/bin
> \[template@es-mstr-01 bin\]$ sudo ./elasticsearch-create-enrollment-token -s node
> /usr/share/elasticsearch/jdk/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
> \[template@es-mstr-01 bin\]$ ./elasticsearch-create-enrollment-token -s node
> ./elasticsearch-env: line 83: /usr/share/elasticsearch/jdk/bin/java: Operation not permitted
> \`\`\`
> 
> 
> \### Logs (if relevant)
> 
> \_No response\_

> [@Cannot Open Shared Object File](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/9):
>
> That does not sound like a good way to install elasticsearch for something else than development. May be do it again and try the 6.2.4 (which I don't believe will change anything).

> [@Error while loading shared libraries: libjli.so](https://discuss.elastic.co/t/error-while-loading-shared-libraries-libjli-so/177319):
>
> When I try to start an instance of Elasticsearch 7, I get this error. Some backstory, I am running on port 443 instead of 9200. Previous versions worked fine after running sudo setcap 'CAP\_NET\_BIND\_SERVICE=+eip' /usr/lib/jvm/default-java/bin/java. But it looks like elasticsearch 7 (when installed through apt-get) is running an internal version of java located /usr/share/elasticsearch/jdk/bin/java. Therefore running sudo setcap 'CAP\_NET\_BIND\_SERVICE=+eip' /usr/share/elasticsearch/jdk/bin/java …

Let us know how you get on!

---

<div class="post-metadata">

**Author:** ![mjanzen](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mjanzen](https://discuss.elastic.co/u/mjanzen)\
**Post date:** [February 4, 2025, 8:57pm UTC](https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862/3 "2025-02-04T20:57:56Z")

</div>

This was a result of the DISA Stig installation.

I re-deployed with the standard RHEL Image and the issue was resolved.

---

<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:** [March 4, 2025, 8:58pm UTC](https://discuss.elastic.co/t/new-install-8-17-scripts-not-working-java/373862/4 "2025-03-04T20:58:19Z")

</div>

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