UPDATE: See resolution here.
Thanks to everyone for their help!
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.
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
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):
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/*
The build-common.xml file specifies for javac:
<attribute name="source" default="7"/>
<attribute name="target" default="7"/>
The same build file has worked fine for others and can be found at: https://github.com/cdlockard/appinventor-sources/blob/master/appinventor/build-common.xml
After reading this, I checked for earlier Java versions on my machine and didn't find any.
Per this question, I added
executable="/usr/bin/javac"
to the build-common.xml file to ensure that it found the correct Java compiler, but the error continued.
The command line output is as follows:
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 <options> <source files>
[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.
Running ant in verbose yielded the following details:
[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 <options> <source files>
[javac] use -help for a list of possible options
[ant] Exiting /Users/username/git/appinventor-sources/appinventor/common/build.xml.
Any ideas? Help would be greatly appreciated.