How to connect java to local elastic search?

i want to connect my local elastic search to java.

https://www.elastic.co/guide/en/elasticsearch/client/index.html

Thanks for give fast reply.
i already used this.
My Code is:
Node node = nodeBuilder()
.settings(ImmutableSettings.settingsBuilder().put("path.home", "/home/amit/elasticsearch-2.1.0/bin"))
.client(true)
.node();
Client client = node.client();

When i used "ImmutableSettings" in elasticsearch 2.1.1 then i got "ImmutableSettings cannot be resolved" this type of error.

Please help me out...

Try using the TransportClient instead of the NodeBuilder

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

Ivan