# Debug Elasticsearch with IntelliJ

**URL:** <https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942>\
**Category:** Elasticsearch\
**Created:** [December 9, 2017, 8:48pm UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942 "2017-12-09T20:48:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukekingbru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukekingbru/32/25254_2.png) [@lukekingbru](https://discuss.elastic.co/u/lukekingbru)\
**Post date:** [December 9, 2017, 8:48pm UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942/1 "2017-12-09T20:48:17Z")

</div>

How to config Program arguments in IntelliJ ?

I got this error when I try to run:

ERROR: the system property [es.path.conf] must be set

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 9, 2017, 10:06pm UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942/2 "2017-12-09T22:06:25Z")

</div>

Running Elasticsearch through IntelliJ is not easy to do properly (e.g., the modules will not be there without significant effort). Instead, you should start Elasticsearch from the command line and attach IntelliJ to the running instance. To do this:

1. from the root of the repository, run `gradle :distribution:tar:assemble`
2. untar the distribution from `distribution/tar/build/distributions` somewhere on your filesystem (e.g.,`tar xf distribution/tar/build/distributions/elasticsearch-7.0.0-alpha1-SNAPSHOT.tar.gz -C ~/elasticsearch`) if you are building from master which is currently on 7.0.0-alpha1 and you want to untar to `~/elasticsearch`)
3. run Elasticsearch from the location that you exploded the tarball to with `ES_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 bin/elasticsearch`)
4. attach IntelliJ to the running instance: Run -\> Edit Configurations -\> Click + -\> Select Remote -\> ensure that the port is set to 5005, name the configuration "localhost:5005" -\> Click Apply; in the upper right-hand corner (assuming a default layout) is a dropdown from which you need to select the configuration "localhost:5005" and click the bug icon to the right of it

Now Elasticsearch will start running and you can set breakpoints etc.

---

<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:** [January 6, 2018, 10:06pm UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942/3 "2018-01-06T22:06:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alex\_Marquardt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_marquardt/32/42925_2.png) [@Alex\_Marquardt](https://discuss.elastic.co/u/Alex_Marquardt)\
**Post date:** [February 4, 2019, 9:07am UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942/4 "2019-02-04T09:07:36Z")

</div>

After downloading Elasticsearch from github, in the top level directory there is file called CONTRIBUTING.md which describes how to configure your IDE, and there is also a file called TESTING.asciidoc which describes how to debug.

Based on the instructions contained in those text files, I have written a blog post that gives step-by-step instructions on how to configure IntelliJ IDEA to debug Elasticsearch and Lucene.

> **[Debugging Elasticsearch and Lucene with IntelliJ IDEA](https://alexmarquardt.com/2019/02/02/debugging-elasticsearch-and-lucene-with-intellij-idea/)**
>
> Introduction IntelliJ IDEA is a Java integrated development environment (IDE) for developing computer software. In this blog post, I discuss how to setup an IntelliJ IDEA project that will allow in…

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 4, 2019, 9:30am UTC](https://discuss.elastic.co/t/debug-elasticsearch-with-intellij/110942/5 "2019-02-04T09:30:48Z")

</div>

That's great. Thanks for sharing it with the community.
