How to debug elastic search in an IDE

I'm trying to learn the internal workings of ES. How can I get ES running on the IDEA ide ?


check out elasticsearch on the master branch, run gradle idea and then just import the elasticsearch.ipr project (on osx just run open elasticsearch.ipr.



What should the configuration be to run elastic search ?

I used the following configuration:

main class: org.elasticsearch.bootstrap.Elasticsearch

Vm options:


working directory: ES directory

environment variable: ES_TEST_LOCAL=true

use classpath of module: core

and when i try to run i get the following error:

Exception in thread "main" java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.intellij.rt.execution.application.AppMain.main(


not sure what is wrong here, did you import the project differently (trying to import via IDEA's import functionality instead of using gradle idea and opening the project file? If you just want to debug something, you could take a look at the integration test cases, and extend from ESIntegTestCase