Hello and welcome to Biostars!
First a mild disclaimer: some of the below is speculation based on interpretation of error messages. Having said that, here are my thoughts:
Step 1: Uninstalling Old Version of Apache Ant
Locate the Installation: Output from the whereis command shows multiple locations related to Apache Ant reflecting the various versions. But, the executable should be located in /usr/bin/ant, and shared files are in /usr/share/ant. One possible source of confusion could be if /usr/bin/ant is not a directory but a symbolic link or an executable ... in particular in considering your confusion about the installation location, it seems possible the actual installation might be spread across these directories ...
Manual Uninstallation: Given the uncertainty of how Ant was installed (e.g., through a package manager or manually), the safest approach is manual removal...
- Start by removing the Ant executable:
sudo rm /usr/bin/ant
- Next, remove the directory containing the shared files and libraries:
sudo rm -r /usr/share/ant
I do confess the rather unexpected directory /mnt/d/everything/ant is a bit concerning. My guess is it resulted from the manual unpacking of the new version. For that reason, I'd leave it as is for now..it's possible it could be necessary to revisit this though.
At any rate, after that, verify correct removal:
ant -version # Here the desired output is of course an error stating ant is not found
Step 2: Pre-Installation: Check Java installation and version
As you've pointed out, Ant requires that Java be installed and configured correctly on your system. So, before installation, check to see if is installed and if so what version of Java installation you're running with:
java -version
Depending on the result of this command, you'll either learn that Java is not installed, or that it is installed but not the right version, or that it is correctly installed and the right version (this is my guess), but if that ends up being a sticking point, let us know. While we're discussing Java, will go ahead and mention my best guess is that the issues with Trimmomatic don't directly relate to Ant. I'll discuss Trimmomatic at the end of this post for that reason, but it's always possible I am wrong...
Step 3: Install the new version of Apache Ant
You have apparently already downloaded and unpacked Ant 1.10.14 in /mnt/d/everything/ant.
The next thing is to configure it to be used globally. One way of doing this is to set environment variables by adding them to your .bashrc or .bash_profile, but there are other ways too that might be more appropriate... anyway, can replace /path/to/apache-ant-1.10.14 with the actual path, which seems to be /mnt/d/everything/ant (I think).
export ANT_HOME=/mnt/d/everything/ant
export PATH=$ANT_HOME/bin:$PATH
After adding these lines, apply the changes by running source ~/.bashrc.
Once these variables are set, you should be able to verify the correct version of Ant is installed via:
ant -version # ideally will return version 1.10.14 - if so we are good
Addressing Java Application Issues (Trimmomatic)
I think the issue with running Trimmomatic and other Java applications is unrelated to Ant, save for conceptually in certain ways...
Instead, my guess is that these issues similarly relate to issues setting up the Java Execution Environment. Why?
Well because the error messages provided (e.g. "no main manifest attribute") strike me as indicating issues with its execution more so than how it was built, so to speak ... my guess is something like a manifest file specifying the main class to execute is absent or misplaced. This would lead JVM to fail to identify the necessary classes to run the program (see the end of 2. for likely reasons why that, in turn, might occur).
Speculation aside, the following would be my first stab at troubleshooting:
Ensure Java Compatibility: Verify that the Java version installed is compatible with the Trimmomatic version you're trying to run. Some Java applications require specific versions of Java.
Correct Way to Run Java Applications: Java applications packaged as JAR files should be executed with the java -jar command. If you receive an error about the main manifest attribute or class not found, it might indicate a missing or incorrect classpath. I suppose it could also indicate that the JAR file is not meant to be executed directly (it might be a library) - not sure on that last.
For Trimmomatic: If you have specific issues with Trimmomatic, ensure you're following the correct command syntax and have all necessary files.
java -jar /path/to/your/trimmomatic.jar
Trimmomatic's documentation or help command can provide guidance on usage if it becomes needed.
Let us know what happens, and good luck.