title: Ant build failing, "[javac] javac: invalid target release: 7"
body: <p>UPDATE:
  <a href="https://stackoverflow.com/questions/21690464/ant-build-failing-javac-javac-invalid-target-release-7/21743233#21743233">See resolution here.</a></p>
  
  <p>Thanks to everyone for their help!</p>
  
  <hr>
  
  <p>I'm encountering an error when attempting to compile a project with Ant, which is claiming "[javac] javac: invalid target release: 7" and causing the build to fail. </p>
  
  <p>I am running javac version 1.7.0_40 on a Mac OSX Mavericks machine. Ant version: Apache Ant(TM) version 1.8.3 compiled on February 26 2012</p>
  
  <p>It is only when attempting to compile with Ant that the problem occurs. Compiling individual files in the project with javac at the command line works properly (with the following command):</p>
  
  <pre><code>javac -d /Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils -classpath /Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils:/Users/username/git/appinventor-sources/appinventor/lib/guava/guava-14.0.1.jar -target 7 -encoding utf-8 -g:lines,vars,source -source 7 common/src/com/google/appinventor/common/utils/*
  </code></pre>
  
  <p>The build-common.xml file specifies for javac:</p>
  
  <pre><code>&lt;attribute name="source" default="7"/&gt;
  &lt;attribute name="target" default="7"/&gt;
  </code></pre>
  
  <p>The same build file has worked fine for others and can be found at:
  <a href="https://github.com/cdlockard/appinventor-sources/blob/master/appinventor/build-common.xml" rel="nofollow noreferrer">https://github.com/cdlockard/appinventor-sources/blob/master/appinventor/build-common.xml</a></p>
  
  <p>After reading <a href="https://stackoverflow.com/questions/15377436/javac-version-1-7-not-able-to-build-for-target-1-7">this</a>, I checked for earlier Java versions on my machine and didn't find any. </p>
  
  <p>Per <a href="https://stackoverflow.com/questions/7832298/how-to-tell-ant-to-build-using-a-specific-javac-executable">this question</a>, I added </p>
  
  <pre><code>executable="/usr/bin/javac"
  </code></pre>
  
  <p>to the build-common.xml file to ensure that it found the correct Java compiler, but the error continued.</p>
  
  <p>The command line output is as follows:</p>
  
  <pre><code>init:
  
  CommonUtils:
  [javac] Compiling 1 source file to /Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils
  [javac] javac: invalid target release: 7
  [javac] Usage: javac &lt;options&gt; &lt;source files&gt;
  [javac] use -help for a list of possible options
  
  BUILD FAILED
  /Users/username/git/appinventor-sources/appinventor/build.xml:16: The following error occurred while executing this line:
  /Users/username/git/appinventor-sources/appinventor/build-common.xml:318: The following error occurred while executing this line:
  /Users/username/git/appinventor-sources/appinventor/common/build.xml:42: The following error occurred while executing this line:
  /Users/username/git/appinventor-sources/appinventor/build-common.xml:120: Compile failed; see the compiler error output for details.
  </code></pre>
  
  <p>Running ant in verbose yielded the following details:</p>
  
  <pre><code>[javac] Compiling 1 source file to /Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils
  [javac] Using modern compiler
  [javac] Compilation arguments:
  [javac] '-d'
  [javac] '/Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils'
  [javac] '-classpath'
  [javac] '/Users/username/git/appinventor-sources/appinventor/common/build/classes/CommonUtils:/Users/username/git/appinventor-sources/appinventor/lib/guava/guava-14.0.1.jar'
  [javac] '-target'
  [javac] '7'
  [javac] '-encoding'
  [javac] 'utf-8'
  [javac] '-g:lines,vars,source'
  [javac] '-verbose'
  [javac] '-source'
  [javac] '7'
  [javac] 
  [javac] The ' characters around the executable and arguments are
  [javac] not part of the command.
  [javac] File to be compiled:
  [javac]     /Users/username/git/appinventor-sources/appinventor/common/src/com/google/appinventor/common/utils/package-info.java
  [javac] javac: invalid target release: 7
  [javac] Usage: javac &lt;options&gt; &lt;source files&gt;
  [javac] use -help for a list of possible options
    [ant] Exiting /Users/username/git/appinventor-sources/appinventor/common/build.xml.
  </code></pre>
  
  <p>Any ideas? Help would be greatly appreciated.</p>