title: ElasticSearch and Java environment variable
body: <p>For Windows 7, I've installed  JDK in both 32 and 64 bit versions. The versions are 8, update 20 for all four installations.
  <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a></p>
  
  <p>when I download and unzip elasticsearch, and run /bin/service.bat or /bin/elasticsearch.bat files, I get in my terminal:</p>
  
  <p><code>JAVA_HOME environment variable must be set!
  Press any key to continue . . .</code></p>
  
  <p>When I do, the terminal closes.</p>
  
  <p>I've uninstalled and reinstalled, but that didn't fix it. Why wouldn't the environment varaible get set? Is it an installation thing, or do I actually have to manually set the variable. It just seems like if it installed correctly, it would set the variable automatically... Please help. Thanks</p>
  
  <p>I've manually set the JAVA_HOME environment variable using this.</p>
  
  <p><a href="https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows">https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows</a></p>
  
  <p>My path is <code>C:\Progra~1\Java\jdk1.8.0_20\jre</code></p>
  
  <p>Now, when I run service.bat, the terminal immediately closes upon opening.
  When I run elasticsearch.bat, the terminal prints some lines, and after a while, it just stays there, and I can't type anything.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I uninstalled all java, reinstalled only the JRE 64 bit, and set the system environment variable to <code>JAVA_HOME</code> and `C:\Progra~1\Java\jre1.8.0_20</p>
  
  <p>I have discovered that there is <code>CLASSPATH</code> that's set to a 32bit, older java version. Should I delete that variable?</p>