title: Trying to find where Ant's javac -source 1.4 argument comes from
body: <p>I'm maintaining an old Java project that was originally written in 1.4 and is now being migrated to a Java 7 environment. The project uses Ant.</p>
  
  <p>When building I receive the following warning</p>
  
  <pre><code>warning: [options] bootstrap class path not set in conjunction with -source 1.4
  </code></pre>
  
  <p>and I think I've now done enough reading to understand that this is because I'm using the Java 7 compiler to compile code to run in 1.4. However I don't want this - I want to use the 7 compiler to build 7 code.</p>
  
  <p>Using <code>ant -v</code> I see that the argument <code>-source 1.4</code> is passed to the javac command but I can't find where it's coming from. None of the build.properties files used by build.xml provide this argument. The project uses some xmlbean functionality and the warning is issued when building the xmlbean target in build.xml.</p>
  
  <p>I have some other projects that are going through a similar process and these do not issue the warning during the build. In these projects Ant does not pass -source 1.4. to javac They are not using xmlbeans so I thought maybe the issue could be related to this.</p>
  
  <p>After a lot of searching I decided I would just put the 1.4 rt.jar on the classpath and forget about it. However this didn't help. I first included it in the xmlbeans target's classpath and then as the 'bootclashpath' property for the whole build.xml file, but no joy.</p>
  
  <p>The relevant section of build.xml looks like this</p>
  
  <pre><code>&lt;target name="xmlbeans" depends="setup"&gt;
      &lt;xmlbean classgendir="${schema.compile.dir}" destfile="${dist.dir}/${schema.jar.file}" failonerror="true"&gt;
          &lt;fileset dir="${config.dir}"&gt;
              &lt;include name="**/*.xsd"/&gt;
          &lt;/fileset&gt;
          &lt;classpath&gt;
              &lt;pathelement location="${lib.dir}/xbean.jar"/&gt;
              &lt;pathelement location="${lib.dir}/jsr173_1.0_api.jar"/&gt;
          &lt;/classpath&gt;
      &lt;/xmlbean&gt;
  &lt;/target&gt;
  
  &lt;taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean"&gt;
      &lt;classpath&gt;
          &lt;pathelement location="${lib.dir}/xbean.jar"/&gt;
          &lt;pathelement location="${lib.dir}/jsr173_1.0_api.jar"/&gt;
      &lt;/classpath&gt;
  &lt;/taskdef&gt;
  </code></pre>