Hi,
Synopsis: have downloaded 2 different apache ant versions, one is installed, the other is just downloaded and unzipped. The old version I cannot find in my file system so I can install the other one without issue.
I recently downloaded apache ant (https://ant.apache.org/) through my ubuntu system on my windows machine using github: https://github.com/apache/ant Desired version 1.10.14
Unlike many individuals using apache ant, I am using it through a command-line ubuntu interface exclusively. I do have visual studio code if that is necessary, though.
I used git clone and tar -xvzf to unpack without realizing that I had previously installed ant at some point, but version 1.10.12
If I currently run
$ant -version
I get returned:
Apache Ant(TM) version 1.10.12 compiled on January 17 1970
Ignoring the date which I think is a bug, I want to uninstall this old version so I can get 1.10.14 properly installed and configured.
I ran:
$whereis ant
which returned:
ant: /usr/bin/ant /usr/share/ant /mnt/d/everything/ant /usr/share/man/man1/ant.1.gz
/mnt/d/everything/ant
is the directory where I just unpacked 1.10.14
$cd /usr/bin/ant
returns:
-bash: cd: /usr/bin/ant: Not a directory
--> checking /usr/bin
, confirms this is not, in fact, a directory
$cd /usr/share/ant
worked, has subdirectory lib which contains tons of jar files, but no filenames inform me of version
Tried to "summon" (sorry, unsure of java terminology) one of the jar files:
$java -jar ant-antlr.jar
returns:
no main manifest attribute, in ant-antlr.jar
--> I am having this exact issue occur when I try to use Trimmomatic, another jar script, tried many many fixes and never was able to get it
I get other errors when I go into
/usr/share/ant/etc
and try to "summon" a jar file in there too
return:
Error: Could not find or load main class org.apache.tools.ant.Main
Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain
Rest of directory is full of .xsl files
I was hoping summoning the jar(s) might allow me to use a help command which might have had version info.
From here, what should I do to figure out where the version 1.10.12 install is truly located?
In case it mattered for any reason, the ultimate end goal of reinstalling ant is so I can rebuild Trimmomatic and pray that fixes the issue I am having with using the trimmomatic java script.
Thanks for your time!
Hi LauferVA,
Thank you very much for your time and help on this issue, unfortunately, I have run into a problem while trying your solution:
I did the following: $sudo rm /usr/bin/ant
$sudo rm -r /usr/share/ant
$ant -version Command 'ant' not found, but can be installed with: sudo apt install ant --> Good, that means my old ant is now gone as I wanted it originally.
$java -version java version "21.0.2" 2024-01-16 LTS
Now try to get new ant configured:
$cd /mnt/d/everything/ant
$export ANT_HOME=/mnt/d/everything/ant
$export PATH=$ANT_HOME/bin:$PATH
$source ~/.bashrc
$ant -version
Returned: Command 'ant' not found, but can be installed with: sudo apt install ant
My guess is that I did something incorrectly during these steps:
" $export ANT_HOME=/mnt/d/everything/ant
$export PATH=$ANT_HOME/bin:$PATH
$source ~/.bashrc "
Do you know where I went wrong? was "$PATH" supposed to be replaced with a real path?
Any help is appreciated, thank you! Best, Matt