# Java: cannot find symbol class RestHighLevelClient

**URL:** <https://discuss.elastic.co/t/java-cannot-find-symbol-class-resthighlevelclient/274028>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 26, 2021, 8:47am UTC](https://discuss.elastic.co/t/java-cannot-find-symbol-class-resthighlevelclient/274028 "2021-05-26T08:47:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pinto/32/78181_2.png) [@pinto](https://discuss.elastic.co/u/pinto)\
**Post date:** [May 26, 2021, 8:47am UTC](https://discuss.elastic.co/t/java-cannot-find-symbol-class-resthighlevelclient/274028/1 "2021-05-26T08:47:30Z")

</div>

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

```auto
 <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:

```auto
    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.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 26, 2021, 9:57am UTC](https://discuss.elastic.co/t/java-cannot-find-symbol-class-resthighlevelclient/274028/2 "2021-05-26T09:57:42Z")

</div>

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?

---

<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:** [June 23, 2021, 12:55pm UTC](https://discuss.elastic.co/t/java-cannot-find-symbol-class-resthighlevelclient/274028/4 "2021-06-23T12:55:43Z")

</div>

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