# How to debug Elasticsearch in IDEA?

**URL:** <https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642>\
**Category:** Elasticsearch\
**Created:** [June 2, 2016, 4:34am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642 "2016-06-02T04:34:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clay](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Clay](https://discuss.elastic.co/u/Clay)\
**Post date:** [June 2, 2016, 4:34am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/1 "2016-06-02T04:34:25Z")

</div>

Hi there,  
I got an errot when I was trying to start elasticsearch from source code which was the latest version I cloned from github.

Elasticesearch will **run successfully** if I run the **_gradle run_** command.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/cc09d76cff8e7c1716e95d5baf6324846c87f440.png)

But it will throw an error ( **path.home** is not configured) when I Elasticsearch.java ( I:\SourceCode\elasticsearch\core\src\main\java\org\elasticsearch\bootstrap\Elasticsearch.java).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e39913d264fcfd89b00e4d78b4510a2335859daf.png)

So I set the confirmation like this . ( However , I don't know whether it is right or not .)......Error again ...

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/c3a10f7c3146795c6e3ae0ff59ffb12e03491961.png)

Is there any problem in the configuration that I set ?  
And which directory should I set to **_-Des.path.home=_**?

I am new to _discuss_ and elastic and even new to Java.  
I need your help please .  
Best wishes for you all.  
Thank you .

finally{  
System.out.println("Sorry for my poor English.");  
}

---

<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:** [June 2, 2016, 6:14am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/2 "2016-06-02T06:14:11Z")

</div>

`path.home` can be whatever dir you want.

Note that you will probably need to add a `config` dir in it with `elasticsearch.yml` and `logging.yml`.

That being said, it could be better to start a normal elasticsearch instance and connect the intelliJ debugger to this JVM?

Read this: [https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#debugging-from-an-ide](https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#debugging-from-an-ide)

---

<div class="post-metadata">

**Author:** ![Rajnikant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajnikant/32/6490_2.png) [@Rajnikant](https://discuss.elastic.co/u/Rajnikant)\
**Post date:** [June 2, 2016, 7:20am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/3 "2016-06-02T07:20:28Z")

</div>

can you share your java code fro helping out?

---

<div class="post-metadata">

**Author:** ![Clay](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Clay](https://discuss.elastic.co/u/Clay)\
**Post date:** [June 2, 2016, 8:53am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/4 "2016-06-02T08:53:48Z")

</div>

I run the exactly "_ **gradle run --debug-jvm** _" in my console ,but turns out error again.  
And , the error is same as I mentioned in picture 2 above .

Am I run a wrong gradle command ?  
Is **--debug-jvm** just a symbol of a serial of arguments ?

---

<div class="post-metadata">

**Author:** ![Clay](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Clay](https://discuss.elastic.co/u/Clay)\
**Post date:** [June 2, 2016, 8:55am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/5 "2016-06-02T08:55:52Z")

</div>

I just followed @dadoonet 's suggestion.

I download a package from _[elastic.co](http://elastic.co)_, and put some arguments in **jvm.options** like this :

> -Xdebug -Xrunjdwp:transport=dt\_socket,server=y,suspend=y,address=5005

then start this elasticsearch instance .

---

<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:** [June 2, 2016, 8:57am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/6 "2016-06-02T08:57:37Z")

</div>

May be open an issue?

We might need to fix this documentation if it does not work OOTB anymore?

---

<div class="post-metadata">

**Author:** ![Clay](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Clay](https://discuss.elastic.co/u/Clay)\
**Post date:** [June 2, 2016, 9:24am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/7 "2016-06-02T09:24:45Z")

</div>

May be some other problems existed in my work.

I failed running **gradle build**. Because I can start an elasticsearch instance by running **gradle run** , I just ignore it .

I need some more time...

![](https://us1.discourse-cdn.com/elastic/original/2X/9/99e6d79d7e90589c5edf45763cc0667d5d896ecd.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a7c7da93b1b10816ae71ba4b2e5ac1067df2fbce.PNG)

---

<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:** [June 2, 2016, 9:50am UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/8 "2016-06-02T09:50:22Z")

</div>

gradle install should skip the tests IIRC

---

<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 5, 2017, 10:46pm UTC](https://discuss.elastic.co/t/how-to-debug-elasticsearch-in-idea/51642/9 "2017-07-05T22:46:56Z")

</div>


