WindowsのJDKのバージョンを差し替えるバッチ

JDK7にする

@echo off  
echo Setting JAVA_HOME  
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51
echo setting PATH  
set PATH=%JAVA_HOME%\bin;%PATH%  
echo Display java version  
java -version  

JDK8にする

@echo off  
echo Setting JAVA_HOME  
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
echo setting PATH  
set PATH=%JAVA_HOME%\bin;%PATH%  
echo Display java version  
java -version