# Elasticsearch Java API Tutorial

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307>\
**Category:** Elasticsearch\
**Created:** [February 8, 2017, 2:12am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307 "2017-02-08T02:12:04Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 8, 2017, 2:12am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/1 "2017-02-08T02:12:04Z")

</div>

Is there any working tutorial around that guides people on how to the java api?

The official document is totally useless. Too many assumption were made and not documented.

I am stuck at [https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.3/\_maven\_repository.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.3/_maven_repository.html) step. Maven information there is not usable on eclipse. The eclipse Java project will still throw many exceptions after downloading jar files from [http://search.maven.org/#search|ga|1|a%3A"elasticsearch"](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22elasticsearch%22)

Is there a "Hello World" equivalent java application out there that can be used as reference?

---

<div class="post-metadata">

**Author:** ![wenpos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenpos/32/15326_2.png) [@wenpos](https://discuss.elastic.co/u/wenpos)\
**Post date:** [February 8, 2017, 3:14am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/2 "2017-02-08T03:14:42Z")

</div>

what 's you ES version? is your dependency packages are complete and version correct. a simple way to resolve dependencies is to get the packages in $ES\_HOME/lib depended.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 8, 2017, 6:21am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/3 "2017-02-08T06:21:21Z")

</div>

version is 2.3.4

---

<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 8, 2017, 6:51am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/4 "2017-02-08T06:51:19Z")

</div>

Does mvn install works from the command line?

Is maven able to download all artifacts of your project?

If so, then you have an issue between maven and eclipse.

If not, may be share your `pom.xml` file?

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 8, 2017, 7:20am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/5 "2017-02-08T07:20:43Z")

</div>

the maven artifacts cannot be found on eclipse.

It requires some kind of repository url which I have not idea where to get it.

I cannot find much information on using maven on eclipse.

---

<div class="post-metadata">

**Author:** ![wenpos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenpos/32/15326_2.png) [@wenpos](https://discuss.elastic.co/u/wenpos)\
**Post date:** [February 8, 2017, 9:10am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/6 "2017-02-08T09:10:22Z")

</div>

you may not config you maven project well, this may help [http://maven.apache.org/configure.html](http://maven.apache.org/configure.html)

---

<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 8, 2017, 10:53am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/7 "2017-02-08T10:53:38Z")

</div>

Again:

> [@dadoonet](#):
>
> - Does mvn install works from the command line?
> - may be share your pom.xml file?

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 10, 2017, 1:48am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/8 "2017-02-10T01:48:08Z")

</div>

What IDE should I use? Tried eclipse and cannot get it to work. POM.xml download from [http://search.maven.org/#search|ga|1|a%3A"elasticsearch"](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22elasticsearch%22).

Is eclipse supported?

---

<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 10, 2017, 11:30am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/9 "2017-02-10T11:30:01Z")

</div>

> [@gringo](#):
>
> Is eclipse supported?

Yes.

What is the pom.xml you wrote?

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 23, 2017, 10:23am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/10 "2017-02-23T10:23:28Z")

</div>

> [@gringo](#):
>
> [Maven Central Repository Search](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22elasticsearch%22)

I have no idea what is pom.xml. I dowloaded it from [Maven Central Repository Search](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22elasticsearch%22) and have no idea what to do with it

---

<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 23, 2017, 10:36am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/11 "2017-02-23T10:36:54Z")

</div>

You can't do anything with that.

If you don't use something like maven or gradle then you will have a lot of manual things to do to be able to use the transport client.

Highly recommended to use maven or gradle.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 24, 2017, 6:57am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/12 "2017-02-24T06:57:34Z")

</div>

Is there a place where I can find tutorial on how to use maven. Did google but can't find anything useful

---

<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 24, 2017, 7:14am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/13 "2017-02-24T07:14:22Z")

</div>

> [@gringo](#):
>
> Did google but can't find anything useful

You can't be serious.

[https://maven.apache.org/guides/](https://maven.apache.org/guides/)

But please then ask questions you have about Maven on maven mailing list unless it's related to elasticsearch.

Also Gradle is a bit newer (and what we are using at elastic), so may be try instead [Gradle User Manual](https://gradle.org/docs#getting-started) ?

Eclipse supports Gradle as well AFAIK.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 6, 2017, 2:21am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/14 "2017-03-06T02:21:12Z")

</div>

I have concluded my exploration on this.

Conclusion is there are too many things to learn in order to use the elasticsearch Java api. These things contains little or no working documentation. It is too costly and not feasible to use the elasticsearch Java API despite having programmers who know Java.

---

<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:** [March 6, 2017, 4:33am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/15 "2017-03-06T04:33:57Z")

</div>

Alternatively you can download maven  
Run mvn dependency:tree  
Grab the list of all jars and their versions  
Add them manually to eclipse

But this requires a lot of manual work.

---

<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:** [April 3, 2017, 4:34am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-tutorial/74307/16 "2017-04-03T04:34:15Z")

</div>

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