title: After upgrading to Java8, javac still shows 1.7
body: <p>I'm having issues upgrading from JDK 1.7 -> 1.8 on OSX.  The upgrade has completed, but javac still returns 1.7 as the version.</p>
  
  <p>I've downloaded <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" rel="nofollow noreferrer">JDK 8_u5</a> from Oracle's homepage, and run the installer.</p>
  
  <p>I've also taken the following steps, post-install:</p>
  
  <pre><code>&gt; export JAVA_HOME=`/usr/libexec/java_home -v 1.8`  (Executed in my .bashrc file)
  
  &gt; echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
  
  &gt; javac -version
  javac 1.7.0_21
  
  &gt; $JAVA_HOME/bin/javac -version
  javac 1.7.0_21
  
  &gt; $JAVA_HOME/bin/java -version    
  java version "1.8.0_05"
  Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
  </code></pre>
  
  <p>I've gone through and removed Java 1.7 (and all other JDK versions), and then re-run the installer:</p>
  
  <pre><code>&gt; ls /Library/Java/JavaVirtualMachines
  jdk1.8.0_05.jdk
  </code></pre>
  
  <p>Still no use, javac reports the version as 1.7.0_21</p>
  
  <pre><code>&gt; which javac
  /usr/bin/javac
  
  &gt; ls -ltra /usr/bin/javac 
  [snipped] /usr/bin/javac -&gt; /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
  </code></pre>
  
  <p>Within that path, <code>Current</code> is a symlink to <code>A</code>. The contents of <code>A/Commands</code> are a series of files (not symlinks).  </p>
  
  <pre><code>&gt; cd A/Commands
  &gt; ./javac -version
  javac 1.7.0_21
  
  &gt; ./java -version
  java version "1.8.0_05"
  Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
  </code></pre>
  
  <h2>Edit</h2>
  
  <p>Further to the original post, I've done some digging with <a href="https://github.com/gcuisinier/jenv" rel="nofollow noreferrer">jenv</a>, as suggested on <a href="https://stackoverflow.com/a/21148562/59015">this answer</a>.</p>
  
  <pre><code>&gt; jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home                 
  &gt; jenv global oracle64-1.8.0.05
  &gt; jenv version
  oracle64-1.8.0.05 (set by /Users/martypitt/.jenv/version)
  
  &gt; jenv info java 
  Jenv will exec : /Users/martypitt/.jenv/versions/oracle64-1.8.0.05/bin/java
  
  &gt; jenv info javac
  Jenv will exec : /Users/martypitt/.jenv/versions/oracle64-1.8.0.05/bin/javac
  
  &gt; javac -version
  javac 1.7.0_21
  </code></pre>
  
  <p>This casts dispersions on my thoughts that this was a random javac lurking in my path, which was somehow getting invoked.</p>
  
  <p>To be sure, I've nuked my Java completely, and tried again:</p>
  
  <pre><code>&gt; cd /Library/Java/JavaVirtualMachines
  &gt; ls 
  jdk1.7.0_55.jdk 
  jdk1.8.0_05.jdk
  &gt; sudo rm -rf *  
  &gt; ls
  &lt;&lt;empty&gt;&gt;
  &gt; java -version
  java version "1.6.0_65"
  &gt; javac -version
  javac 1.6.0_65
  &gt; which javac
  /usr/bin/javac
  </code></pre>
  
  <p>I then re-downloaded a <a href="http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-macosx-x64.dmg" rel="nofollow noreferrer">fresh copy the installer</a> and ran it.</p>
  
  <pre><code>&gt; java -version
  java version "1.8.0_05"
  &gt; javac -version
  javac 1.7.0_21
  </code></pre>
  
  <h2>Update</h2>
  
  <p>I tried removing all JDK's, XCode and all developer tools, and re-installed fresh.
  Same results.</p>
  
  <p>However, I'm still at a loss -- where do I go from here?  How do I get javac 1.8 to get installed?</p>