# Unable to Connect to Elasticsearch 6.1.0 via the javaclient

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-6-1-0-via-the-javaclient/112358>\
**Category:** Elasticsearch\
**Created:** [December 19, 2017, 6:30am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-6-1-0-via-the-javaclient/112358 "2017-12-19T06:30:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [December 19, 2017, 6:50am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-6-1-0-via-the-javaclient/112358/2 "2017-12-19T06:50:16Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Some thoughts:

- Prefer using the Java REST Client instead
- Share you code
- Add missing libs (log4j2) although it's probably not the problem here.

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-6-1-0-via-the-javaclient/112358)._
