Solved :Java High Level RestClient 6.1.3 NoClassDefFoundError

I'm trying to create a very simple Rest Client, as described in the docs.
I'm using maven with this 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>(

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

What can I do to solve this?


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


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 : and

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


If useful, I added the following JARs :
-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

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.

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