title: Switching between multiple java versions
body: <p>OS : OSX Yosemite</p>
  <p>I use <a href="https://github.com/gcuisinier/jenv" rel="nofollow noreferrer">jEnv</a> to switch between java versions.</p>
  <pre><code>Asiris-Mac-Book-Pro:~ Asiri$ jenv global 1.6 
  
  Asiris-Mac-Book-Pro:~ Asiri$ java -version
  java version &quot;1.6.0_65&quot;
  Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
  Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
  
  
  Asiris-Mac-Book-Pro:~ Asiri$ /usr/libexec/java_home
  /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
  
  Asiris-Mac-Book-Pro:~ Asiri$ /usr/libexec/java_home -V
  Matching Java Virtual Machines (4):
      1.7.0_67, x86_64:   &quot;Java SE 7&quot; /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
      1.6.0_65-b14-466.1, x86_64: &quot;Java SE 6&quot; /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
      1.6.0_65-b14-466.1, i386:   &quot;Java SE 6&quot; /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
      1.5.0_30-b03, x86_64:   &quot;J2SE 5.0&quot;  /System/Library/Java/JavaVirtualMachines/1.5.0/Contents/Home
  
  /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
  </code></pre>
  <p>Why is this happening?</p>
  <p>This configuration till seems to use the java 1.7.</p>
  <p>How to correctly switch to java 1.6?</p>