How to change Ant compiler to JDK 1.6
===

I need to compile my source code to be compatible with jre 1.6. However, when I attempt to set the compiler attribute of the javac task to be javac1.6, ant will still compile my code with javac1.7. I have also tried setting the compiler version to be "modern" and that did not help.

    <target name="compile-tests">
		<javac compiler="javac1.6" includeantruntime="false" srcdir="${test.dir}"
         destdir="${build.dir}" >
			<classpath refid="class.path" />
		</javac>
	</target>

My JAVA_HOME is set to JDK 1.6:

    echo $JAVA_HOME </code> gives: <code>
    /usr/lib/jvm/java-6-openjdk-amd64/

My ant version is: 
    Apache Ant(TM) version 1.8.2 


According to [this post][1], ant uses its own compiler. How do I override the ant default?
Also, according to [this post][2] and the ant documentation, I can set the global build.compiler property. What do I set that property to be and how might I do that?


  [1]: http://stackoverflow.com/questions/10543336/which-javac-exe-is-used-by-ant-javac-task
  [2]: http://stackoverflow.com/questions/235363/override-the-compiler-attribute-in-an-ant-javac-task