How to debug Elasticsearch in IDEA?

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.

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).

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

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.");
}

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

can you share your java code fro helping out?

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 ?

I just followed @dadoonet 's suggestion.

I download a package from 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 .

May be open an issue?

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

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...


gradle install should skip the tests IIRC