title: Permission denied Exception while Running Embedded ElasticSearch
body: <p>I am using <a href="https://github.com/allegro/embedded-elasticsearch" rel="nofollow noreferrer">https://github.com/allegro/embedded-elasticsearch</a> for writing integration tests for Elastic. After initial setup when I ran the tests this plugin downloaded the elastic instance successfully but start giving <strong>permission denied errors.</strong> </p>
  
  <p><strong>My Java version :</strong> </p>
  
  <pre><code>openjdk 11.0.2 2019-01-15
  OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
  OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
  </code></pre>
  
  <p><strong>Full Stack Trace</strong></p>
  
  <pre><code>Exception in thread "EmbeddedElsHandler" pl.allegro.tech.embeddedelasticsearch.EmbeddedElasticsearchStartupException: java.io.IOException: Cannot run program "/var/folders/ql/403xvvqs42v00xlnqgr6d8540000gn/T/embedded-elasticsearch-temp-dir/elasticsearch-6.6.0/bin/elasticsearch": error=13, Permission denied
      at pl.allegro.tech.embeddedelasticsearch.ElasticServer.lambda$startElasticProcess$6(ElasticServer.java:89)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: java.io.IOException: Cannot run program "/var/folders/ql/403xvvqs42v00xlnqgr6d8540000gn/T/embedded-elasticsearch-temp-dir/elasticsearch-6.6.0/bin/elasticsearch": error=13, Permission denied
      at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
      at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
      at pl.allegro.tech.embeddedelasticsearch.ElasticServer.lambda$startElasticProcess$6(ElasticServer.java:80)
      ... 1 more
  Caused by: java.io.IOException: error=13, Permission denied
      at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
      at java.base/java.lang.ProcessImpl.&lt;init&gt;(ProcessImpl.java:340)
      at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
      at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
      ... 3 more
  </code></pre>
  
  <p><strong>My Embedded Elastic Configuration</strong></p>
  
  <pre><code>@BeforeClass
  public static void setup() {
   final EmbeddedElastic embeddedElastic = EmbeddedElastic.builder()
   .withElasticVersion("6.6.0")
   .withSetting(PopularProperties.TRANSPORT_TCP_PORT, "9200")
   .withSetting(PopularProperties.CLUSTER_NAME, "partner_portal_elasticsearch_cluster")
   .withPlugin("analysis-stempel") // Commented this line, with this line permission deined came while installing the plugin
    .build();
  
       try {
           embeddedElastic.start();
          System.out.println("Embedded Elastic Search instance started................");
       } catch (IOException e) {
           e.printStackTrace();
       } catch (InterruptedException e) {
          e.printStackTrace();
       }
    }
  </code></pre>
  
  <p>ElasticSearch bin Folder looks like this (for permission reference)
  <a href="https://i.stack.imgur.com/tBrHL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tBrHL.png" alt="enter image description here"></a></p>