# Setting up Elastic search on Windows 11 machine

**URL:** <https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904>\
**Category:** Elastic Search\
**Created:** [June 23, 2024, 2:02pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904 "2024-06-23T14:02:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 23, 2024, 2:02pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/1 "2024-06-23T14:02:30Z")

</div>

I am trying to setup Elastic search on Windows 11 machine. Following instructions as outlined in:

[Setup, Run & Debug Elasticsearch Source Code in IntelliJ IDEA | Elastic Blog](https://www.elastic.co/blog/how-to-debug-elasticsearch-source-code-in-intellij-idea) & CONTRIBUTING.md.

After importing the project into I build the project with Build gradle in IntelliJ. After I tried to run using the command **./gradlew run --debug-jvm** the process itself took more than 3hrs and threw an exception after that. Below are the details of the exception. I tried to search for answers but no luck. Really appreciate if I can get some guidance on this.

`````auto
shree@Sreevardhana MINGW64 ~/repositories/elasticsearch/elasticsearch (main)
$ ./gradlew run --debug-jvm

> Configure project :modules:reindex
Disabling reindex-from-old tests because we can't get the pid file on windows

> Configure project :x-pack:qa:repository-old-versions
Disabling repository-old-versions tests because we can't get the pid file on windows
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version : 8.8
  OS Info : Windows 11 10.0 (amd64)
  JDK Version : 17.0.10+11-LTS-240 (Oracle)
  JAVA_HOME : C:\Users\shree\Software\jdk17
  Random Testing Seed : EA40C128BCCF3E87
  In FIPS 140 mode : false
=======================================

> Task :x-pack:plugin:sql:sql-client:compileJava
Note: C:\Users\shree\repositories\elasticsearch\elasticsearch\x-pack\plugin\sql\sql-client\src\main\java\org\elasticsearch\xpack\sql\client\RemoteFailure.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :libs:elasticsearch-simdvec:compileMain21Java
Note: Some input files use preview features of Java SE 21.
Note: Recompile with -Xlint:preview for details.                                                                                                                                    

> Task :libs:elasticsearch-native:compileMain21Java
Note: Some input files use preview features of Java SE 21.
Note: Recompile with -Xlint:preview for details.

> Task :x-pack:plugin:security:cli:compileJava
Note: C:\Users\shree\repositories\elasticsearch\elasticsearch\x-pack\plugin\security\cli\src\main\java\org\elasticsearch\xpack\security\cli\CertificateGenerateToolProvider.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :run
Running elasticsearch in debug mode, node{::runTask-0} expecting running debug server on port 5007

> Task :run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> process was found dead while waiting for ports files, node{::runTask-0}

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3h 9m 7s
581 actionable tasks: 310 executed, 271 up-to-date
````Preformatted text`
`````

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [June 24, 2024, 12:21pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/2 "2024-06-24T12:21:32Z")

</div>

It would be helpful to know what Elasticsearch logged. If you're running this from source, it should be in your `elasticsearch` directory under `build/testclusters/runTask-0/logs/es.out`. That may provide some more helpful context about what was happening before gradle crashed.

---

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 24, 2024, 12:39pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/3 "2024-06-24T12:39:51Z")

</div>

Kathleen Madam,

Thank you so much for your response. Please let me know if you need anything else. Setup instructions ([Setup, Run & Debug Elasticsearch Source Code in IntelliJ IDEA | Elastic Blog](https://www.elastic.co/blog/how-to-debug-elasticsearch-source-code-in-intellij-idea)) do not seem to be applicable in 2024. I would really appreciate if you have a document which is more current.

Below are the errors I am seeing in the es.out. The error file(hs\_err\_pid%p.log) mentioned is not there in the specified folder.

Thanks  
Sree

java.lang.RuntimeException: starting java failed with [2]  
output:  
[Global flags]  
ccstr ErrorFile = C:\Users\shree\repositories\elasticsearch\elasticsearch\build\testclusters\runTask-0\logs\hs\_err\_pid%p.log {product} {command line}

error:  
WARNING: Using incubator modules: jdk.incubator.vector  
ERROR: transport error 202: connect failed: Connection refused  
ERROR: JDWP Transport dt\_socket failed to initialize, TRANSPORT\_INIT(510)  
JDWP exit error AGENT\_ERROR\_TRANSPORT\_INIT(197): No transports initialized [s\open\src\jdk.jdwp.agent\share\native\libjdwp\debugInit.c:700]  
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:120)  
at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:87)  
at org.elasticsearch.server.cli.MachineDependentHeap.determineHeapSettings(MachineDependentHeap.java:55)  
at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:145)  
at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:97)  
at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:254)  
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:101)  
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:94)  
at org.elasticsearch.cli.Command.main(Command.java:51)  
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)

---

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 24, 2024, 2:33pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/4 "2024-06-24T14:33:49Z")

</div>

Kathleen Madam,

Issue with starting elasticsearch in Debug has been resolved. I found the solution through a different post in elasticsearch posts. But still request to kindly help with the following:

a) Seeing "\<============-\> 99% EXECUTING [23m 38s]" in the startup logs. Does that application has started successfully.  
b)When trying to Attach process getting timeout error as shown in the below logs. Am I missing any additional step.

Connected to the target VM, address: 'localhost:5007', transport: 'socket'  
Disconnected from the target VM, address: 'localhost:5007', transport: 'socket'  
Connected to the target VM, address: 'localhost:5007', transport: 'socket'  
Disconnected from the target VM, address: 'localhost:5007', transport: 'socket'  
Connected to the target VM, address: 'localhost:5007', transport: 'socket'

Connecting to Sreevardhana:60908  
Exception in thread "main" java.net.ConnectException: Connection timed out: connect  
at java.base/sun.nio.ch.Net.connect0(Native Method)  
at java.base/sun.nio.ch.Net.connect(Net.java:579)  
at java.base/sun.nio.ch.Net.connect(Net.java:568)  
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)  
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)  
at java.base/java.net.Socket.connect(Socket.java:633)  
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)  
at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:45)  
"C:\Users\shree\Software\IntelliJ IDEA Community Edition 2024.1.4\bin\launcher.exe" C:\Users\shree\Software\jdk17/bin/java --add-modules jdk.hotspot.agent --add-exports jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.memory=ALL-UNNAMED --add-opens jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.classfile=ALL-UNNAMED --add-exports jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED -cp "C:\Users\shree\Software\IntelliJ IDEA Community Edition 2024.1.4\plugins\java\lib\sa-jdwp.jar" com.jetbrains.sa.SaJdwpAttachingServer 10808 Sreevardhana:60908  
sa-jdwp server connected  
Connecting to Sreevardhana:60908  
Exception in thread "main" java.net.ConnectException: Connection timed out: connect  
at java.base/sun.nio.ch.Net.connect0(Native Method)  
at java.base/sun.nio.ch.Net.connect(Net.java:579)  
at java.base/sun.nio.ch.Net.connect(Net.java:568)  
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)  
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)  
at java.base/java.net.Socket.connect(Socket.java:633)  
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)  
at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:45)

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [June 24, 2024, 3:09pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/5 "2024-06-24T15:09:35Z")

</div>

Correct, the blog you linked has a notification at the top of the post that indicates this is out of date for versions starting with 7.5. I would suggest looking at our [CONTRIBUTING.md](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md#importing-the-project-into-intellij-idea) page for current IntelliJ setup instructions.

Try following the setup and debug instructions from the updated documentation, that may solve your issue.

---

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 24, 2024, 11:21pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/6 "2024-06-24T23:21:36Z")

</div>

Went through the CONTRIBUTING.md but unfortunately it doesn't have any additional instructions on how to run Elastic search in Debug in IntelliJ. After following some other post I was able to get Elastic search in Debug mode but facing the below issue while trying to "Attach process". Am I missing any additional steps.

Connected to the target VM, address: 'localhost:5007', transport: 'socket'  
Disconnected from the target VM, address: 'localhost:5007', transport: 'socket'  
Connected to the target VM, address: 'localhost:5007', transport: 'socket'  
Disconnected from the target VM, address: 'localhost:5007', transport: 'socket'  
Connected to the target VM, address: 'localhost:5007', transport: 'socket'

Connecting to Sreevardhana:60908  
Exception in thread "main" java.net.ConnectException: Connection timed out: connect  
at java.base/sun.nio.ch.Net.connect0(Native Method)  
at java.base/sun.nio.ch.Net.connect(Net.java:579)  
at java.base/sun.nio.ch.Net.connect(Net.java:568)  
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)  
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)  
at java.base/java.net.Socket.connect(Socket.java:633)  
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)  
at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:45)  
"C:\Users\shree\Software\IntelliJ IDEA Community Edition 2024.1.4\bin\launcher.exe" C:\Users\shree\Software\jdk17/bin/java --add-modules jdk.hotspot.agent --add-exports jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.memory=ALL-UNNAMED --add-opens jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.utilities=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.classfile=ALL-UNNAMED --add-exports jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED -cp "C:\Users\shree\Software\IntelliJ IDEA Community Edition 2024.1.4\plugins\java\lib\sa-jdwp.jar" com.jetbrains.sa.SaJdwpAttachingServer 10808 Sreevardhana:60908  
sa-jdwp server connected  
Connecting to Sreevardhana:60908  
Exception in thread "main" java.net.ConnectException: Connection timed out: connect  
at java.base/sun.nio.ch.Net.connect0(Native Method)  
at java.base/sun.nio.ch.Net.connect(Net.java:579)  
at java.base/sun.nio.ch.Net.connect(Net.java:568)  
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)  
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)  
at java.base/java.net.Socket.connect(Socket.java:633)  
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)  
at com.jetbrains.sa.SaJdwpAttachingServer.main(SaJdwpAttachingServer.java:45)

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [June 25, 2024, 12:31pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/7 "2024-06-25T12:31:15Z")

</div>

OK, well in case something funny is going on with your settings, here is my Debug configuration in IntelliJ. You should have this when you import the project:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/1/4107dea311e4dade4903c9fb72642516d85abbab.png)

If you launch Gradle with `--debug-jvm` and start that Debug configuration, it should attach automatically.

---

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 26, 2024, 12:46pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/8 "2024-06-26T12:46:19Z")

</div>

Thanks for the screenshot that helped. Now I was able to start elasticsearch in Intellij in debug mode successfully.Wanted to test if the elasticsearch is running or not by executing localhost:4200 in CURL.  
Getting missing authentication credentials for the REST request. Below are the error details.How do I test the running instance of elasticsearch from windows machine locally? Is it even possible. Thank you,

{"error":{"root\_cause":[{"type":"security\_exception","reason":"unable to authenticate user [elastic] for REST request [/]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}}],"type":"security\_exception","reason":"unable to authenticate user [elastic] for REST request [/]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}},"status":401}

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [June 26, 2024, 1:53pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/9 "2024-06-26T13:53:51Z")

</div>

You want to use the credentials we specify in our [CONTRIBUTING.md](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md) docs: `elastic-admin:elastic-password`

---

<div class="post-metadata">

**Author:** ![shreedaddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedaddy/32/135478_2.png) [@shreedaddy](https://discuss.elastic.co/u/shreedaddy)\
**Post date:** [June 27, 2024, 3:44am UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/10 "2024-06-27T03:44:59Z")

</div>

Thanks for your help that worked like a charm. Sorry I missed that.

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [June 27, 2024, 12:33pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/11 "2024-06-27T12:33:50Z")

</div>

Great! Happy debugging!

---

<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 25, 2024, 12:34pm UTC](https://discuss.elastic.co/t/setting-up-elastic-search-on-windows-11-machine/361904/12 "2024-07-25T12:34:01Z")

</div>

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