# Java client usage

**URL:** <https://discuss.elastic.co/t/java-client-usage/4807>\
**Category:** Elasticsearch\
**Created:** [July 7, 2011, 12:02pm UTC](https://discuss.elastic.co/t/java-client-usage/4807 "2011-07-07T12:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![santana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santana/32/3180_2.png) [@santana](https://discuss.elastic.co/u/santana)\
**Post date:** [July 7, 2011, 12:02pm UTC](https://discuss.elastic.co/t/java-client-usage/4807/1 "2011-07-07T12:02:59Z")

</div>

Can someone explain the best way to use ES from a java application ?

- Use HttpClient to connect to the server and send json requests

- Use the java API

I am confused on how the java API should be used. My understanding is that you can package the client with an application as an embeded search server ?

Thanks for this clarification

---

<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 6, 2017, 4:01am UTC](https://discuss.elastic.co/t/java-client-usage/4807/2 "2017-07-06T04:01:28Z")

</div>


