Q:

source value 1.5 is obsolete and will be removed in a future release

How do I prevent the two warnings below from generating an error that stops the build process ?
-compile:
    [javac] Compiling 77 source files to /Users/andev/Workspace/android/products/myproject/1.0/Facebook/bin/classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] error: warnings found and -Werror specified
    [javac] 1 error
    [javac] 3 warnings

A:

Another possibility (which will fix it for all Android builds made with Ant), is to tweak the default parameters for the -compile task in <android-sdk>\tools\ant\build.xml.
At the <!-- compilation options --> section, you can either set the compiler flags:
<property name="java.compilerargs" value="-Xlint:-options" />

or, alternatively, change the source and target parameters:
<property name="java.target" value="1.6" />
<property name="java.source" value="1.6" />

As of now, 1.6 is enough to avoid the warning.

A:

To be able to build, I created a file ant.properties in the facebook project (first project that is compiled) with the contents :
java.compilerargs=-Xlint:-options

A:

This is set in the ${sdk.dir}/tools/ant/build.xml file. At the beginning of the file are many property settings, e.g.
<!-- compilation options -->
<property name="java.encoding" value="UTF-8" />
<property name="java.target" value="1.5" />
<property name="java.source" value="1.5" />
<property name="java.compilerargs" value="" />
<property name="java.compiler.classpath" value="" />

Also at the beginning of this file is a comment

At the beginning of the file is a list of properties that can be overridden
by adding them to your ant.properties (properties are immutable, so their
first definition sticks and is never changed).

So, in order to override any property in general and source value and target value in particular, you can put these properties into the ant.properties file in your project directory
java.source=1.6
java.target=1.6

This overrides the default settings in ${sdk.dir}/tools/ant/build.xml and thus prevents the warnings.

