用ant编译build.xml
结果出以下错误
The <javac> task doesn't support the "source" attribute.出错的语句是
 <target name="compile" depends="prepare-src">
    <javac srcdir="${src.dir}"
           destdir="${build.dest}"
           debug="${debug}"
           classpathref="build.classpath"
           optimize="${optimize}"
           source="1.4" />  @@@@@@@@@@@@@这一句@@@@@@@@@@@@@@@@@@@@@
  </target>换了ant的版本1.5,1.8都试了,都出这个错误
真搞不懂是怎么回事
请教大家
不胜感激....

解决方案 »

  1.   

    把source去掉即可 或者你试一下 source="1.2"
      

  2.   

    请注意这个关于 source 的解释
    Value of the -source command-line switch; will be ignored by all implementations prior to javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes.
    If you use this attribute together with jikes, you must make sure that your version of jikes supports the -source switch. By default, no -source argument will be used at all.
    Note that the default value depends on the JVM that is running Ant. We highly recommend to always specify this attribute.
    A default value for this attribute can be provided using the magic ant.build.javac.source property.我在写ant的时候这个变量我一般不写的……
    希望这个对你有用