title: Compile legacy Java code with java1.6 JDK
body: <p>I'm compiling many legacy Java code probably written with Java1.3 and I got tons of errors like this:</p>
  
  <pre><code>Copydir.java:128: warning: as of release 5, 'enum' is a keyword, and may not be used as an identifier
  
  [javac] (use -source 5 or higher to use 'enum' as a keyword)
  [javac]             Enumeration enum = filecopyList.keys();
  </code></pre>
  
  <p>It's too time consuming to replace each instance of enum with _enum so I added source="1.3" in ant javac task as below (based on examples from <a href="http://ant.apache.org/manual/Tasks/javac.html" rel="nofollow">http://ant.apache.org/manual/Tasks/javac.html</a>). But I still got the same compile error. I've tried to change source = 1.4,1.5, and still same error.</p>
  
  <pre><code>&lt;javac srcdir="${src.dir}"
  
  destdir="${build.classes}"
  
  debug="true" debuglevel="lines,vars,source"
  
  source="1.3"
  
  deprecation="off"
  
  optimize="on"&gt; 
  </code></pre>
  
  <p>What is the right way to tell comiler that the source is written in 1.3, but I want to compile it to run in 1.6? I'm using jdk1.6.0.26 and ant 1.8.2</p>