title: Setting Java Environment Variable for Elasticsearch Service
body: <p>Our Elasticsearch cluster went down and when I tried to restart it with:</p>
  
  <pre><code>docker start -i elasticsearch
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Error: encountered environment variables that are no longer supported
  Use jvm.options or ES_JAVA_OPTS to configure the JVM
  ES_HEAP_SIZE=6g: set -Xms6g and -Xmx6g in jvm.options or add "-Xms6g -Xmx6g" to ES_JAVA_OPTS
  </code></pre>
  
  <p>I'm not quite sure where to set the options for this. I modified our elasticsearch.service file to include it on start:</p>
  
  <pre><code>ExecStart=/usr/bin/docker run --name elasticsearch -p ####:#### -p ####:#### -e ES_HEAP_SIZE=6g -e ES_JAVA_OPTS="-Xms6g -Xmx6g" -v /srv/esconfig:/usr/share/elasticsearch/confg
  </code></pre>
  
  <p>But the error persists.</p>