# Dependencies with elasticsearch

**URL:** https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159
**Category:** Elasticsearch
**Created:** [June 28, 2016, 12:04pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159 "2016-06-28T12:04:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Meriem\_Rezgui](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Meriem\_Rezgui](https://discuss.elastic.co/u/Meriem_Rezgui)
#### Post date: [June 28, 2016, 12:04pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/1 "2016-06-28T12:04:26Z")

</div>

hello,  
i'm new with elasticsearch and i'm trying to make a java application that will allow me to communicate with a cluster elasticsearch . i started with creating a maven project and in the pom.xml i have put in my pom.xml the code bellow:

```
      <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>2.3.3</version>
      </dependency>

```

in the main class i have put 🙂

```
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.io.Files;
import org.elasticsearch.common.*;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.node.Node;

import java.io.*;

import static java.lang.System.out;
import static org.elasticsearch.common.xcontent.XContentFactory.*;
import static org.elasticsearch.node.NodeBuilder.*;

public class ELK_connexion {

	public static void main (String[] args){
	 // ES client creation
    Node node = nodeBuilder().node();
    Client client = new TransportClient()
                   .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
	
	} 

```

but the import org.elasticsearch.common.io.Files; didn't work and i have errors :Description Resource Path Location Type  
The constructor InetSocketTransportAddress(String, int) is undefined   
Description Resource Path Location Type  
The constructor TransportClient() is undefined

can anyone tell me what is the problem  
thanks a lot

---

<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: [June 28, 2016, 12:19pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/2 "2016-06-28T12:19:44Z")

</div>

Please format your code.

And read this: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html)

---

<div class="post-metadata">

### Author: ![Meriem\_Rezgui](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Meriem\_Rezgui](https://discuss.elastic.co/u/Meriem_Rezgui)
#### Post date: [June 28, 2016, 12:34pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/3 "2016-06-28T12:34:22Z")

</div>

ok thank you @dadoonet but do you know why the import org.elasticsearch.common.io.Files; is not working

---

<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: [June 28, 2016, 12:59pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/4 "2016-06-28T12:59:54Z")

</div>

I modified your question so formatting is better.

> why the import org.elasticsearch.common.io.Files;

Why are you importing it?

---

<div class="post-metadata">

### Author: ![Meriem\_Rezgui](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Meriem\_Rezgui](https://discuss.elastic.co/u/Meriem_Rezgui)
#### Post date: [June 29, 2016, 8:37am UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/5 "2016-06-29T08:37:04Z")

</div>

thanks for your answer it helped me and yes i didn't need this

---

<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: [July 5, 2017, 10:39pm UTC](https://discuss.elastic.co/t/dependencies-with-elasticsearch/54159/6 "2017-07-05T22:39:41Z")

</div>


