Dependencies with elasticsearch

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

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

Please format your code.

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

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

I modified your question so formatting is better.

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

Why are you importing it?

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