# RestClient

**URL:** <https://discuss.elastic.co/t/restclient/137059>\
**Category:** Elasticsearch\
**Created:** [June 22, 2018, 4:41pm UTC](https://discuss.elastic.co/t/restclient/137059 "2018-06-22T16:41:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Bakopoulos](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@Andreas\_Bakopoulos](https://discuss.elastic.co/u/Andreas_Bakopoulos)\
**Post date:** [June 22, 2018, 4:41pm UTC](https://discuss.elastic.co/t/restclient/137059/1 "2018-06-22T16:41:10Z")

</div>

Hi,

I am trying to use the java client but a receive the following error:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/elasticsearch/client/RestClient

Could you please help me to solve this issue?

Best regards,  
Andreas Bakopoulos

---

<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:** [June 23, 2018, 8:14am UTC](https://discuss.elastic.co/t/restclient/137059/2 "2018-06-23T08:14:10Z")

</div>

You need to add the client to your project. Which you probably did not.

I'd read: [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/index.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/index.html)

---

<div class="post-metadata">

**Author:** ![Andreas\_Bakopoulos](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@Andreas\_Bakopoulos](https://discuss.elastic.co/u/Andreas_Bakopoulos)\
**Post date:** [June 26, 2018, 5:28pm UTC](https://discuss.elastic.co/t/restclient/137059/3 "2018-06-26T17:28:17Z")

</div>

I use java 1.6 and I have insert in my pom the following dependency:

```
	<dependency>
		<groupId>org.elasticsearch.client</groupId>
		<artifactId>elasticsearch-rest-client</artifactId>
		<version>6.2.4</version>
	</dependency>

```

The application builts successfully but when I try to use the RestClient, i receive the following error:  
java.lang.NoClassDefFoundError: org/elasticsearch/client/RestClient

---

<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:** [June 26, 2018, 5:40pm UTC](https://discuss.elastic.co/t/restclient/137059/4 "2018-06-26T17:40:52Z")

</div>

Not sure this is your issue but you need at least Java 1.8.

---

<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 24, 2018, 5:41pm UTC](https://discuss.elastic.co/t/restclient/137059/5 "2018-07-24T17:41:04Z")

</div>

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