CLASSPATH
is not meant to search for jars. It is meant to search for classes. Putting a jar in CLASSPATH
means java will see the classes inside the jar, but not the jar itself.
What you want is more likely a shell script wrapper starting the jar.
Create a text file containing the following lines:
#!/bin/sh java -jar /usr/local/bin/gatk/GenomeAnalysisTK.jar
Make the file executable (suppose you name it GenomeAnalysisTK
):
chmod +x GenomeAnalysisTK
Put that file in /usr/local/bin
or ~/bin
or wherever you want provided the path is in your $PATH
.
From now on you can call the shell script and it will start the jar. No need to mess with CLASSPATH
anymore.
Alternatively: with the jar in the classpath you can start the main class from inside the jar like this:
java org.broadinstitute.sting.gatk.CommandLineGATK
The main class of the jar is specified in the file META-INF/MANIFEST.MF
inside the jar. For more information see the wikipedia article about jar files.