# Solved :Java High Level RestClient 6.1.3 NoClassDefFoundError

**URL:** <https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436>\
**Category:** Elasticsearch\
**Created:** [February 5, 2018, 12:03pm UTC](https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436 "2018-02-05T12:03:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Foerster](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Christian\_Foerster](https://discuss.elastic.co/u/Christian_Foerster)\
**Post date:** [February 5, 2018, 12:03pm UTC](https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436/1 "2018-02-05T12:03:05Z")

</div>

Hi,  
I'm trying to create a very simple Rest Client, as described in the docs.  
I'm using maven with this dependency:

```
<dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>6.1.3</version>
   </dependency>

RestClientBuilder builder = RestClient.builder(
            new HttpHost("localhost", 9200, "http"));
RestHighLevelClient client = new RestHighLevelClient(builder);

```

But I get this error:

```
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/util/Version
	    at org.elasticsearch.Version.<clinit>(Version.java:44)
       ...

```

The org.apache.lucene.util.Version seems to be no longer part of the lucene-core dependency.

What can I do to solve this?

Cheers  
Christian

UPDATE: it turned out, that the local maven repos has some problems fetching the lucene jar, so that it was empty...

---

<div class="post-metadata">

**Author:** ![Akita](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Akita](https://discuss.elastic.co/u/Akita)\
**Post date:** [February 12, 2018, 7:28pm UTC](https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436/2 "2018-02-12T19:28:50Z")

</div>

Hi!

I'm getting the exact same error, but I'm not using Maven (which I know very little about), and I manually get the JARs I need (the ones in the documentation :[https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.1/java-rest-high-getting-started-dependencies.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.1/java-rest-high-getting-started-dependencies.html) and [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.1/java-rest-low-usage-dependencies.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.1/java-rest-low-usage-dependencies.html))

But obviously, at least one is missing. Which one is it or how can I know this? Where can I find it?

Thanks!

PS:  
If useful, I added the following JARs :  
-elasticsearch  
-elasticsearch-transport  
-elasticsearch-rest-client  
-elasticsearch-rest-high-level-client  
-elasticsearch-rest-high-level-client-sniffer (All the five are 6.1.3)

-apache's httpasyncclient 4.1.3  
-httpclient 4.5.5  
-httpcore 4.4.9  
-httpcore-nio 4.4.9

-commons-codec 1.9  
-commons-logging 1.2

---

<div class="post-metadata">

**Author:** ![Akita](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Akita](https://discuss.elastic.co/u/Akita)\
**Post date:** [February 14, 2018, 8:17am UTC](https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436/3 "2018-02-14T08:17:12Z")

</div>

I ended up using Maven, of course.

Piece of advice for those who want to do a small project like me and not use Maven: use Maven. "elasticsearch-rest-high-level-client" is recursively relying on 60 or 70 dependencies. Maven (or Gradle) handles everything.

---

<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:** [March 14, 2018, 8:17am UTC](https://discuss.elastic.co/t/solved-java-high-level-restclient-6-1-3-noclassdeffounderror/118436/4 "2018-03-14T08:17:13Z")

</div>

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