我在/usr/local/ant ....中有一个较新的ANT什么时候"which ant"显示它仍然指向默认的ant"usr/bin/ant"安装在Centos 5.8。如何修改?
尝试了以下更改,但没有成功:
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc
将您的有效路径作为path环境变量的第一个路径:
export PATH=/usr/local/ant/bin:$PATH