title: Switching between different JDK versions in Windows
body: <p>I'm working on few projects and some of them are using different JDK. Switching between JDK versions is not comfortable. So I was wondering if there is any easy way to change it?</p>
  
  <p>I found 2 ways, which should solve this problem, but it doesn't work.</p>
  
  <p>First solution is creating a bat files like this:</p>
  
  <pre><code>@echo off
  echo Setting JAVA_HOME
  set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_72
  echo setting PATH
  set PATH=C:\Program Files\Java\jdk1.7.0_72\bin;%PATH%
  echo Display java version
  java -version
  pause
  </code></pre>
  
  <p>And after running this bat, I see right version of Java. But when I close this CMD and open a new one and type "java -version" it says that I still have 1.8.0_25. So it doesn't work.</p>
  
  <p>Second solution which I found is an application from <a href="http://mihosoft.eu/?p=649" rel="noreferrer">this </a> site. And it also doesn't work. The same effect as in the first solution.</p>
  
  <p>Any ideas? Because changing JAVA_HOME and PAHT by: Win + Pause -> Advanced System Settings -> Environment Variables -> and editing these variables, is terrible way...</p>