# How to connect Java program in elastic search 7.3.1?

**URL:** <https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825>\
**Category:** Elasticsearch\
**Created:** [September 10, 2019, 4:27am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825 "2019-09-10T04:27:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 10, 2019, 4:27am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/1 "2019-09-10T04:27:50Z")

</div>

![Capture](https://us1.discourse-cdn.com/elastic/original/3X/8/7/87ede921121f1cfe45d0dd143ee70b590c4d1f7f.png)  
Is this above code is not compile successfully.I use elastic search 7.3.1.. So please give me the proper solution to connect elastic search 7.3.1 using java.

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [September 10, 2019, 4:35am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/2 "2019-09-10T04:35:56Z")

</div>

I don't use Java myself but I know that the Transport Client [was deprecated in ES 7.0](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html) and will be removed, so you should have a look at the [REST Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-getting-started-initialization.html) instead.

---

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 10, 2019, 10:41am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/3 "2019-09-10T10:41:39Z")

</div>

How to map Maven project into java Servlet ..Is it possible ? Give me the possible solution ..  
Thanks in advance

---

<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:** [September 10, 2019, 10:58am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/4 "2019-09-10T10:58:52Z")

</div>

I shared some samples here:

> **[dadoonet/elasticsearch-java-client-demo](https://github.com/dadoonet/elasticsearch-java-client-demo)**
>
> Elasticsearch Client Java Sample project. Contribute to dadoonet/elasticsearch-java-client-demo development by creating an account on GitHub.

Not related to servlets in any way but that could help.

---

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 10, 2019, 11:01am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/5 "2019-09-10T11:01:42Z")

</div>

Thanks

---

<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:** [October 8, 2019, 11:01am UTC](https://discuss.elastic.co/t/how-to-connect-java-program-in-elastic-search-7-3-1/198825/6 "2019-10-08T11:01:42Z")

</div>

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