java - 从 ant 更改 javac 路径

标签 java ant javac

使用 fork 时,我可以从 ant 中指定 javac 路径吗?我问这个是因为我需要从自动化 framwork(cruisecontrol) 运行脚本,但是当我使用 fork 时,它使用与框架捆绑在一起的较低版本的 jdk。因此,有什么方法可以为 javac 指定不同的路径吗?

最佳答案

使用build.compiler 系统属性,或在javac 任务上设置compiler 属性:

The compiler implementation to use. If this attribute is not set, the value of the build.compiler property, if set, will be used. Otherwise, the default compiler for the current VM will be used.

http://ant.apache.org/manual/Tasks/javac.html

关于java - 从 ant 更改 javac 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7107168/

相关文章:

ant - 使用 Ant 编译基于单个文件及其依赖项的项目

Java 错误值可能已被分配

java - 接口(interface)中的协变返回类型未通过 Javac 编译

java - 如何查询预定进程(定时器事件)?

java - 如何将不同维度的数组输入到java中的方法中

java - 当VM(虚拟机)重新启动/启动时,如何重新启动Java应用程序?

java - 如果没有更改则跳过 DLL 编译

java - 多列 IN 子句 spring data jpa

java - 如何调试 Eclipse 构建?

java - "package does not exist"使用 Ant 构建 JUnit 测试时出错