# org.elasticsearch.xpack.XPackClient does not exist in the downloaded jar file

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536>\
**Category:** Elasticsearch\
**Created:** [April 17, 2017, 7:33am UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536 "2017-04-17T07:33:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharat\_Jagannath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharat_jagannath/32/24299_2.png) [@Sharat\_Jagannath](https://discuss.elastic.co/u/Sharat_Jagannath)\
**Post date:** [April 17, 2017, 7:33am UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/1 "2017-04-17T07:33:31Z")

</div>

hi  
I downloaded the xpack transport jar file v 5.3 from [https://www.elastic.co/guide/en/x-pack/current/java-clients.html](https://www.elastic.co/guide/en/x-pack/current/java-clients.html)  
After that i tested with example-

```
      import java.net.InetAddress;

     import org.elasticsearch.client.transport.TransportClient;
  import org.elasticsearch.common.settings.Settings;
  import org.elasticsearch.common.transport.InetSocketTransportAddress;
 import org.elasticsearch.xpack.XPackClient;
 import org.elasticsearch.xpack.client.PreBuiltXPackTransportClient;

   public class TestXpaac {

public static void main(String[] args){
Settings settings = Settings.builder().put("xpack.security.user", "elastic:password").build();

try{
	TransportClient client = new PreBuiltXPackTransportClient(settings)
		    .addTransportAddress(new 
InetSocketTransportAddress(InetAddress.getByName("localhost"), 9200));
   // ActionFuture<ClusterHealthResponse> healthFuture = 
 client.admin().cluster().health(Requests.clusterHealthRequest());

    System.out.println("kl="+client.settings().getAsMap());
		XPackClient xpackClient = new XPackClient(client);

 }
catch (Exception e) {
        e.printStackTrace();
        }

    }
   }

```

but even after including the jar in build path i get compiler exception while importing org.elasticsearch.xpack.XPackClient  
I am able to do the same if i use a maven project.  
In that it specifies the org.elasticsearch.plugin x-pack-api- 5.3.0 version.  
This version is not present in the maven website.The latest is 5.0.0.  
Is something wrong with the jar in the website?

Please help.

Thanks

---

<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:** [April 17, 2017, 7:53am UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/2 "2017-04-17T07:53:05Z")

</div>

Probably you did not add the maven repository in your pom.xml.

Run mvn install from the CLI and look at the warn/error messages

---

<div class="post-metadata">

**Author:** ![Sharat\_Jagannath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharat_jagannath/32/24299_2.png) [@Sharat\_Jagannath](https://discuss.elastic.co/u/Sharat_Jagannath)\
**Post date:** [April 17, 2017, 5:26pm UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/3 "2017-04-17T17:26:44Z")

</div>

The code works with maven. I am trying to build it with jar files (no maven).  
Thats when i get the errors.

---

<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:** [April 17, 2017, 6:40pm UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/4 "2017-04-17T18:40:12Z")

</div>

So you have to import manually all dependencies (all jars)

---

<div class="post-metadata">

**Author:** ![Sharat\_Jagannath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharat_jagannath/32/24299_2.png) [@Sharat\_Jagannath](https://discuss.elastic.co/u/Sharat_Jagannath)\
**Post date:** [April 18, 2017, 12:31am UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/5 "2017-04-18T00:31:35Z")

</div>

> [@Sharat\_Jagannath](#):
>
> org.elasticsearch.plugin x-pack-api- 5.3.0

i couldn't find the jar for org.elasticsearch.plugin x-pack-api- 5.3.0

---

<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:** [April 18, 2017, 2:26am UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/6 "2017-04-18T02:26:10Z")

</div>

If you used maven in a previous run then it's probably in your ~/.m2 dir.

---

<div class="post-metadata">

**Author:** ![Sharat\_Jagannath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharat_jagannath/32/24299_2.png) [@Sharat\_Jagannath](https://discuss.elastic.co/u/Sharat_Jagannath)\
**Post date:** [April 18, 2017, 4:03pm UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/7 "2017-04-18T16:03:05Z")

</div>

cool. Thanks @dadoonet

---

<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:** [May 16, 2017, 4:14pm UTC](https://discuss.elastic.co/t/org-elasticsearch-xpack-xpackclient-does-not-exist-in-the-downloaded-jar-file/82536/8 "2017-05-16T16:14:00Z")

</div>

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