Can't run on win10, An error occurred: java.lang.ClassNotFoundException

I am running Elasticsearch on Windows 10, and I have performed the following operations:

C:\Users\Win10\Desktop\elasticsearch-8.15.0\bin>elasticsearch
warning: ignoring JAVA_HOME=C:\Program Files\Java\jdk-22; using bundled JDK
WARNING: Unknown module: org.elasticsearch.preallocate specified to --add-opens
WARNING: Unknown module: org.elasticsearch.nativeaccess specified to --enable-native-access
WARNING: Unknown module: org.apache.lucene.core specified to --enable-native-access
????: ?????????????????? Files\hadoop-3.3.5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023.1.0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\.dotnet\tools;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Java\jre1.8.0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;.
???: java.lang.ClassNotFoundException: Files\hadoop-3/3/5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023/1/0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\/dotnet\tools;C:\Program Files\Java\jdk1/8/0_202\bin;C:\Program Files\Java\jre1/8/0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;/

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

C:\Users\Win10\Desktop\elasticsearch-8.15.0\bin>

Elasticsearch seems unable to start.

I also ran the following code to check the Java environment variables:

C:\Users\Win10\Desktop\elasticsearch-8.15.0\bin>echo %JAVA_HOME%
C:\Program Files\Java\jdk-22

C:\Users\Win10\Desktop\elasticsearch-8.15.0\bin>java -version
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 17.0.5+8-adhoc..jdk17u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 17.0.5+8-adhoc..jdk17u, mixed mode)

I hope Elasticsearch can start normally.

Added windows and removed docker

Hi @cco Welcome to the community.

Try going up 1 directory and run the command correctly as shown here

C:\Users\Win10\Desktop\elasticsearch-8.15.0> .\bin\elasticsearch.bat

Running from the correct relative Directory is important.

I would look at the docs closely and follow the directions carefully.

Damn it, this is my fault. But even after following the documentation, Elasticsearch still seems unsatisfied:

C:\Users\Win10\Desktop\elasticsearch-8.15.0>.\bin\elasticsearch.bat
warning: ignoring JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202; using bundled JDK
WARNING: Unknown module: org.elasticsearch.preallocate specified to --add-opens
WARNING: Unknown module: org.elasticsearch.nativeaccess specified to --enable-native-access
WARNING: Unknown module: org.apache.lucene.core specified to --enable-native-access
????: ?????????????????? Files\hadoop-3.3.5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023.1.0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\.dotnet\tools;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Java\jre1.8.0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;.
???: java.lang.ClassNotFoundException: Files\hadoop-3/3/5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023/1/0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\/dotnet\tools;C:\Program Files\Java\jdk1/8/0_202\bin;C:\Program Files\Java\jre1/8/0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;/

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

C:\Users\Win10\Desktop\elasticsearch-8.15.0> .\bin\elasticsearch.bat
warning: ignoring JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202; using bundled JDK
WARNING: Unknown module: org.elasticsearch.preallocate specified to --add-opens
WARNING: Unknown module: org.elasticsearch.nativeaccess specified to --enable-native-access
WARNING: Unknown module: org.apache.lucene.core specified to --enable-native-access
????: ?????????????????? Files\hadoop-3.3.5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023.1.0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\.dotnet\tools;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Java\jre1.8.0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;.
???: java.lang.ClassNotFoundException: Files\hadoop-3/3/5\bin;C:\Android;C:\Program Files (x86)\ZeroTier\One\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Tailscale\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2023/1/0\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Go\bin;C:\Program Files\Sniffnet\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Win10\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Win10\AppData\Local\Programs\Python\Python310\;C:\Users\Win10\AppData\Local\Microsoft\WindowsApps;C:\Users\Win10\/dotnet\tools;C:\Program Files\Java\jdk1/8/0_202\bin;C:\Program Files\Java\jre1/8/0_202\bin;C:\Program Files (x86)\Nmap;C:\Users\Win10\AppData\Roaming\npm;C:\Users\Win10\go\bin;/

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

C:\Users\Win10\Desktop\elasticsearch-8.15.0>

I have already deleted and re-extracted elasticsearch-8.15.0.

Do you have some java class path defined? I would try minimum env variables

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