Java: cannot find symbol class RestHighLevelClient

Following Java High Level REST Client Getting started documentation. Added to the POM.xml (in IntelliJ):

 <project>
 ...
    <dependencies>
         <dependency>
             <groupId>org.elasticsearch.client</groupId>
             <artifactId>elasticsearch-rest-high-level-client</artifactId>
             <version>7.6.2</version>
         </dependency>
     </dependencies>
 </project>

In the java file added:

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

on build getting error: java: cannot find symbol
symbol: class RestHighLevelClient

I should add that find ~/.m2 -name "elastic*" produces no results.

Try taking your IDE out of the equation and check if you can build and compile your project using maven first. if that works, either refresh your project or reopen in your IDE.

If it does not work via maven, can you share error messages?

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