Installing ElasticSearch-8.14.3 on Windows 11

I have set the ES_JAVA_COME environment variable, but I am unable to start elasticsearch

Have you extracted correctly ES? It seems you don't have tools.jar file.
Have you checked logs\elasticsearch.log?

The JDK in Elasticsearch-8.14.3 does not have tools.jar

I copied tools.jar and put it inside, but it still reports this error

I also couldn't find tools.jar in Elasticsearch-7.17.22, but this version ran successfully

Run elasticsearch.bat not just elasticsearch, and install JDK from the Oracle site(that contains tools.jar), not open JDK. Also set the JAVA_HOME variable.

Hi @sky442146311 welcome to the community...

Did you follow exactly these directions.... Exactly.

Elasticsearch comes with JDK.

I would clean up... Reinstall

AND

It's is very important to run the correct command from the correct directory so Elasticsearch can find the proper JDK.

from the Elasticsearch home directory

.\bin\elasticsearch.bat

Also please do not post images of text. They're very difficult to read and some people can't even see them and they cannot be tested, debugged or searched.

Also please show the directory and the complete command you are running so we can help

Sorry, I didn't know uploading pictures would cause so much trouble
It seems to be a version issue. I switched to the original elasticsearch-8.0.0-windows-x86_64.zip version, which used the same operation and started successfully

I have tried, but the above problem still occurs

I also tried Elasticsearch-8.1.0 on my end, elasticsearch-8.2.0,elasticsearch-8.3.0,elasticsearch-8.4.0,elasticsearch-8.5.0

These two versions have been successfully run: elasticsearch-8.1.0, elasticsearch-8.2.0

Elasticsearch-8.3.0 prints more logs

D:\Progame\elasticsearch-8.3.0\bin>elasticsearch
warning: ignoring JAVA_HOME=D:\Progame\Java\jdk_21; using ES_JAVA_HOME
???? 28, 2024 5:40:01 ???? sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
[2024-07-28T05:40:04,692][ERROR][o.e.b.Elasticsearch      ] [ASXCE] fatal exception while booting Elasticsearch
org.elasticsearch.bootstrap.StartupException: org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.3.0\%JAVA_HOME%\lib\tools.jar
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:228) [elasticsearch-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67) [elasticsearch-8.3.0.jar:?]
Caused by: org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.3.0\%JAVA_HOME%\lib\tools.jar
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:217) ~[elasticsearch-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:224) ~[elasticsearch-8.3.0.jar:?]
        ... 1 more
Caused by: java.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.3.0\%JAVA_HOME%\lib\tools.jar
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
        at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53) ~[?:?]
        at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38) ~[?:?]
        at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:197) ~[?:?]
        at java.nio.file.Files.readAttributes(Files.java:1858) ~[?:?]
        at java.util.zip.ZipFile$Source.get(ZipFile.java:1491) ~[?:?]
        at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724) ~[?:?]
        at java.util.zip.ZipFile.<init>(ZipFile.java:251) ~[?:?]
        at java.util.zip.ZipFile.<init>(ZipFile.java:180) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:345) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:316) ~[?:?]
        at java.util.jar.JarFile.<init>(JarFile.java:255) ~[?:?]
        at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:221) ~[elasticsearch-core-8.3.0.jar:?]
        at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84) ~[elasticsearch-core-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:215) ~[elasticsearch-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-8.3.0.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:224) ~[elasticsearch-8.3.0.jar:?]
        ... 1 more
org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.3.0\%JAVA_HOME%\lib\tools.jar
Likely root cause: java.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.3.0\%JAVA_HOME%\lib\tools.jar
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:197)
        at java.base/java.nio.file.Files.readAttributes(Files.java:1858)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1491)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:251)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:180)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:345)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:316)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:255)
        at org.elasticsearch.base@8.3.0/org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:221)
        at org.elasticsearch.base@8.3.0/org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84)
        at org.elasticsearch.server@8.3.0/org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:215)
        at org.elasticsearch.server@8.3.0/org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333)
        at org.elasticsearch.server@8.3.0/org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:224)
        at org.elasticsearch.server@8.3.0/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67)
For complete error details, refer to the log at D:\Progame\elasticsearch-8.3.0\logs\elasticsearch.log
ERROR: Elasticsearch did not exit normally - check the logs at D:\Progame\elasticsearch-8.3.0\logs\elasticsearch.log

ERROR: Elasticsearch exited unexpectedly

Hi @sky442146311

Ok to be clear... You need to run the correct command from the correct directory... You are doing neither.

You need to navigate to the home directory NOT the bin directory to start the command properly.

So in your case above.

From

D:\Progame\elasticsearch-8.3.0>

Again NOT the bin directory

Then run

.\bin\elasticsearch.bat

with the .bat

Run that let us know...

This approach should work for 8.14 as well

1 Like

Hello @stephenb
I tried following the method you suggested, but it's still the same mistake

warning: ignoring JAVA_HOME=D:\Progame\Java\jdk_21; using ES_JAVA_HOME
???? 30, 2024 9:00:02 ???? sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
[2024-07-30T09:00:03,035][INFO ][o.e.n.NativeAccess       ] [ASXCE] Using [jdk] native provider and native methods for [Windows]
[2024-07-30T09:00:03,088][ERROR][o.e.b.Elasticsearch      ] [ASXCE] fatal exception while booting Elasticsearchjava.nio.file.NoSuchFileException: D:\Progame\elasticsearch-8.14.3\%JAVA_HOME%\lib\tools.jar
        at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
        at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
        at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)

See logs for more details.

ERROR: Elasticsearch did not exit normally - check the logs at D:\Progame\elasticsearch-8.14.3\logs\elasticsearch.log

ERROR: Elasticsearch died while starting up, with exit code 1

Maybe there are some differences in the new version, let me take a closer look

Apologies can you please show the directory and the command you ran... Along with the output/ result.

We really need to see all the context so we can help.

Also Did you cleanup and reinstall/unzip?

Are you installing on a network drive? <<<<<

Are you following the docs?

Did you look at the logs directory and see if there is any more information in the log file?

I just installed myself following the docs and what I suggested and worked
Exactly What OS?

PS C:\Program Files\elasticsearch-8.14.3> pwd

Path
----
C:\Program Files\elasticsearch-8.14.3


PS C:\Program Files\elasticsearch-8.14.3> dir


    Directory: C:\Program Files\elasticsearch-8.14.3


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         7/30/2024   2:31 AM                bin
d-----         7/30/2024   2:31 AM                config
d-----         7/30/2024   2:31 AM                jdk
d-----         7/30/2024   2:31 AM                lib
d-----          7/7/2024  10:06 PM                logs
d-----         7/30/2024   2:31 AM                modules
d-----          7/7/2024  10:06 PM                plugins
-a----         7/30/2024   2:31 AM           3860 LICENSE.txt
-a----         7/30/2024   2:31 AM        2285977 NOTICE.txt
-a----         7/30/2024   2:31 AM           9070 README.asciidoc


PS C:\Program Files\elasticsearch-8.14.3> .\bin\elasticsearch.bat
Jul 30, 2024 2:33:27 AM sun.util.locale.provider.LocaleProviderAdapter <clinit>
[2024-07-30T02:33:29,639][INFO ][o.e.n.NativeAccess       ] [stephenb-w2022] Using [jdk] native provider and native methods for [Windows]
WARNING: COMPAT locale provider will be removed in a future release
[2024-07-30T02:33:31,770][INFO ][o.a.l.i.v.PanamaVectorizationProvider] [stephenb-w2022] Java vector incubator API enabled; uses preferredBitSize=256; FMA enabled
[2024-07-30T02:33:32,943][INFO ][o.e.n.Node               ] [stephenb-w2022] version[8.14.3], pid[6544], build[zip/d55f984299e0e88dee72ebd8255f7ff130859ad0/2024-07-07T22:04:49.882652950Z], OS[Windows Server 2022/10.0/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/22.0.1/22.0.1+8-16]
[2024-07-30T02:33:32,951][INFO ][o.e.n.Node               ] [stephenb-w2022] JVM home [C:\Program Files\elasticsearch-8.14.3\jdk], using bundled JDK [true]
[2024-07-30T02:33:32,951][INFO ][o.e.n.Node               ] [stephenb-w2022] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -Djava.security.manager=allow, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=org.elasticsearch.preallocate, --add-opens=org.apache.lucene.core/org.apache.lucene.store=org.elasticsearch.vec, --enable-native-access=org.elasticsearch.nativeaccess, -XX:ReplayDataFile=logs/replay_pid%p.log, -Djava.library.path=C:\Program Files\elasticsearch-8.14.3\lib\platform\windows-x64;C:\Program Files\elasticsearch-8.14.3\jdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\stephenb\AppData\Local\Microsoft\WindowsApps;C:\Users\stephenb\.dotnet\tools;., -Djna.library.path=C:\Program Files\elasticsearch-8.14.3\lib\platform\windows-x64;C:\Program Files\elasticsearch-8.14.3\jdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\stephenb\AppData\Local\Microsoft\WindowsApps;C:\Users\stephenb\.dotnet\tools;., -Des.distribution.type=zip, -XX:+UnlockDiagnosticVMOptions, -XX:G1NumCollectionsKeepPinned=10000000, -XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\stephenb\AppData\Local\Temp\2\elasticsearch, --add-modules=jdk.incubator.vector, -XX:+HeapDumpOnOutOfMemoryError, -XX:+ExitOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,level,pid,tags:filecount=32,filesize=64m, -Xms4070m, -Xmx4070m, -XX:MaxDirectMemorySize=2133852160, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, --module-path=C:\Program Files\elasticsearch-8.14.3\lib, --add-modules=jdk.net, --add-modules=ALL-MODULE-PATH, -Djdk.module.main=org.elasticsearch.server]
[2024-07-30T02:33:32,951][INFO ][o.e.n.Node               ] [stephenb-w2022] Default Locale [en_US]
[2024-07-30T02:33:38,448][INFO ][o.e.p.PluginsService     ] [stephenb-w2022] loaded module [repository-url]
[2024-07-30T02:33:38,448][INFO ][o.e.p.PluginsService     ] [stephenb-w2022] loaded module [rest-root]
[2024-07-30T02:33:38,448][INFO ][o.e.p.PluginsService     ] [stephenb-w2022] loaded module [x-pack-core]
........

Elasticsearch security features have been automatically configured!
Authentication is enabled and cluster connections are encrypted.
....

Someone had a similar problem on Windows 2016.
Had to add JAVA_HOME in env. variables and logoff/logon or reboot server.

Actually I would try unsetting JAVA_HOME

The tools.jar file exists in Program Files\Java\jdk\lib directory. It doesn't exist in the bundled elasticsearch\jdk\lib. Most likely sky442 is using specific settings in elasticsearch.yml which needs tools.jar or doesn't have rights or ACL had been set on D:\Progame\elasticsearch-8.14.3

I don't think this issue is not directly related to ES. It's more related to Java issues.

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