title: How to change JDK version temporarily for mvn
body: <p>I have used the following command to set the java version temporarily</p>
  
  <pre><code>export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
  export PATH=$JAVA_HOME/bin:$PATH 
  </code></pre>
  
  <p>but when i run <code>mvn -v</code> I see it's pointing to java 7</p>
  
  <p>so how to change <code>JAVA_HOME</code> temporarily and see the effect in <code>mvn -v</code> ??</p>