title: javac: invalid target release: 1.7
body: <p>Using OS X Mavericks, and after upgrading my JDK, I can no longer compile with ant.</p>
  
  <p>I've done the usual googling and the vast majority of answers point to JAVA_HOME not being set.</p>
  
  <p>Help me stackoverflow, you're my only hope!</p>
  
  <p>Information which may be useful</p>
  
  <pre><code>$ tail -n1 /etc/profile
  export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
  
  $ echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
  
  $ which javac
  /usr/bin/javac
  
  $ ls -lah /usr/bin/javac
  lrwxr-xr-x  1 root  wheel    75B  8 Jan 11:23 /usr/bin/javac -&gt; /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
  
  $ ls -lah /System/Library/Frameworks/JavaVM.framework/Versions/
  total 80
  drwxr-xr-x  13 root  wheel   442B 19 Mar 10:10 .
  drwxr-xr-x  12 root  wheel   408B 19 Mar 09:59 ..
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.4 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.4.2 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.5 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.5.0 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.6 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B  8 Jan 11:23 1.6.0 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B 19 Mar 10:10 1.7 -&gt; CurrentJDK
  lrwxr-xr-x   1 root  wheel    10B 19 Mar 10:10 1.7.0 -&gt; CurrentJDK
  drwxr-xr-x   8 root  wheel   272B  8 Jan 11:23 A
  lrwxr-xr-x   1 root  wheel     1B  8 Jan 11:23 Current -&gt; A
  lrwxr-xr-x   1 root  wheel    58B 19 Mar 10:10 CurrentJDK -&gt; /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents
  
  $ javac -version -source 1.7 -target 1.7 -fork true
  javac 1.7.0_51
  javac: invalid source release: 1.7
  Usage: javac &lt;options&gt; &lt;source files&gt;
  </code></pre>