0

我定义了 2 个环境变量:

myuser@mymachine:~$ echo $ANT_HOME
/home/myuser/apache/ant/1.8.4/apache-ant-1.8.4
myuser@mymachine:~$ echo $ANT_IVY_HOME
/home/myuser/apache/ivy/apache-ivy-2.3.0-rc2

我有以下 Ant 版本:

<property environment="env"/>

<target name="testant">
    <echo message="Ant home: ${env.ANT_HOME}"/>
    <echo message="Ant ivy home: ${env.ANT_IVY_HOME}"/>
</target>

当我运行时,testant我得到以下控制台输出:

Buildfile: /home/myuser/eclipse/workspace/myapp/build.xml
testant:
    [echo] Ant home: /home/myuser/apache/ant/1.8.4/apache-ant-1.8.4
    [echo] Ant ivy home: ${env.ANT_IVY_HOME}
BUILD SUCCESSFUL
Total time: 316 milliseconds

为什么 Ant 能识别ANT_HOME但不能识别ANT_IVY_HOME?提前致谢!

4

1 回答 1

2

您只是设置ANT_IVY_HOME而不导出它吗?

于 2013-05-19T03:38:30.997 回答