Bug 58904

Summary: ant -version always reports version 1.7.1
Product: Ant Reporter: zielot
Component: CoreAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 1.9.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description zielot 2016-01-21 19:46:58 UTC
* Download http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.5-bin.tar.gz
* check sha1sum 
  - numbers match

* run the following
  echo $ANT_HOME 
  /opt/ant/apache-ant-1.9.5
  $which ant
  /opt/ant/apache-ant-1.9.5/bin/ant

  $ ant -version
  Apache Ant version 1.7.1 compiled on June 27 2008

  $ /opt/ant/apache-ant-1.9.5/bin/ant -version
  Apache Ant version 1.7.1 compiled on June 27 2008
  

* same problem with 
http://mirror.cc.columbia.edu/pub/software/apache//ant/binaries/apache-ant-1.9.6-bin.tar.gz
http://mirror.cc.columbia.edu/pub/software/apache//ant/binaries/apache-ant-1.9.6-bin.zip
http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.tar.gz
Comment 1 zielot 2016-01-21 20:08:45 UTC
$ java -jar /opt/ant/apache-ant-1.9.4/lib/ant-launcher.jar -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
Comment 2 zielot 2016-01-21 20:10:46 UTC
$ find /opt -iname "ant"
/opt/ant
/opt/ant/apache-ant-1.9.4/manual/api/org/apache/tools/ant
/opt/ant/apache-ant-1.9.4/bin/ant
/opt/app/oracle/product/11.2.0/dbhome_2/oc4j/ant
/opt/app/oracle/product/11.2.0/dbhome_2/oc4j/ant/bin/ant
/opt/weblogic/oracle_common/modules/org.apache.ant_1.8.4/bin/ant
/opt/weblogic/oracle_common/modules/org.apache.ant_1.7.1/bin/ant
/opt/weblogic/wlserver/server/lib/ant
/opt/weblogic/wlserver/plugins/maven/com/oracle/weblogic/ant
/opt/ATG/ATG11.1/CIM/plugins/Base/ant
Comment 3 zielot 2016-01-21 20:31:00 UTC
I deleted the contents of the other ant installations and now I get the proper version so it works. However, this handling by the run script seems entirely wrong to me: the ant script should not be overriding the user's specific request to use a specific version. When I run 
/opt/ant/apache-ant-1.9.5/bin/ant -version
I am clearly not asking the script to search for all possible installations of ANT and try to run the oldest version.