title: ElasticSearch path.home exception on Mac OSX El Capitan using basic Java app
body: <p>I'm trying to get myself familiar with Elastic Search for one project, but I can't seem to get rid of an exception. This is the basic code:</p>
  
  <pre><code>import org.elasticsearch.action.fieldstats.FieldStats;
  import org.elasticsearch.action.index.IndexResponse;
  import org.elasticsearch.client.*;
  import org.elasticsearch.node.Node;
  
  import java.io.IOException;
  
  import static org.elasticsearch.common.xcontent.XContentFactory.*;
  import static org.elasticsearch.node.NodeBuilder.*;
  
  public class Testing {
  
      public static void main(String[] args) throws IOException {
  
          Node node = nodeBuilder().node();
          Client client = node.client();
  
          IndexResponse response = client.prepareIndex("twitter", "tweet", "1")
                  .setSource(jsonBuilder()
                                  .startObject()
                                  .field("user", "kimchy")
                                  .field("postDate", new FieldStats.Date())
                                  .field("message", "trying out Elasticsearch")
                                  .endObject()
                  )
                  .execute()
                  .actionGet();
      }
  }
  </code></pre>
  
  <p>And this is the exception I get:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: path.home is not configured
      at org.elasticsearch.env.Environment.&lt;init&gt;(Environment.java:99)
      at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:85)
      at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:128)
  </code></pre>
  
  <p>I have googled quite a lot, but nowhere can I find an answer as to where to set this parameter "path.home". I have tried setting it in the elasticsearch.yml file both insider the project ../resources folder and inside the install folder of elasticsearch, but didn't succeed. </p>
  
  <p>Maybe I am a bit blind, but your help is greatly appreciated.
  Thank you!</p>