在蚂蚁javac的设置Java的目标版本 [英] Setting the target version of Java in ant javac
本文介绍了在蚂蚁javac的设置Java的目标版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用蚂蚁(1.7.0)到Java的特定版本(1.5)下运行编译一个jar文件。我现在有我的机器上的Java 1.6。我曾尝试设置:
I need to compile a jar file using ant (1.7.0) to run under a specific version of Java (1.5). I currently have Java 1.6 on my machine. I have tried setting:
<target name="compile">
<javac compiler="javac1.5" target="1.5" srcdir=.../>
</target>
我也已经删除。
<property name="build.compiler" value="modern"/>
和没有任何属性文件。我在Linux / SUSE
and there is no properties file. I am running Java 1.6 on Linux/SUSE
也有确定的Java版本的jar文件预计的简单方法。
Also is there a simple way of determining which version of Java is expected in the jar file.
推荐答案
使用目标属性,删除编译属性。这里请参见。因此,它应该是这样的:
Use "target" attribute and remove the 'compiler' attribute. See here. So it should go something like this:
<target name="compile">
<javac target="1.5" srcdir=.../>
</target>
希望这有助于
这篇关于在蚂蚁javac的设置Java的目标版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文