# Version 5 and Java not working

**URL:** <https://discuss.elastic.co/t/version-5-and-java-not-working/64589>\
**Category:** Elasticsearch\
**Created:** [November 1, 2016, 4:55pm UTC](https://discuss.elastic.co/t/version-5-and-java-not-working/64589 "2016-11-01T16:55:35Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [November 30, 2016, 3:14pm UTC](https://discuss.elastic.co/t/version-5-and-java-not-working/64589/6 "2016-11-30T15:14:01Z")

</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.

I just checked on my end and as soon as I add the following in my `pom.xml` file:

```auto
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>transport</artifactId>
    <version>5.0.2</version>
</dependency>

```

I can write this code:

```auto
new PreBuiltTransportClient(Settings.EMPTY)
      .addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress("127.0.0.1", 9300)));

```

If it does not work on your end, then check your IDE, your maven settings, look at eclipse messages.

What does `mvn dependency:tree` is saying?

---

_[View the full topic](https://discuss.elastic.co/t/version-5-and-java-not-working/64589)._
