created by Geraldine_VdAuwera
on 2012-07-24
Objective
Test that the GATK is correctly installed, and that the supporting tools like Java are in your path.
Prerequisites
Steps
The command we're going to run is a very simple command that asks the GATK to print out a list of available command-line arguments and options. It is so simple that it will ALWAYS work if your GATK package is installed correctly.
Note that this command is also helpful when you're trying to remember something like the right spelling or short name for an argument and for whatever reason you don't have access to the web-based documentation.
Action
Type the following command:
java -jar <path to GenomeAnalysisTK.jar> --help
replacing the <path to GenomeAnalysisTK.jar>
bit with the path you have set up in your command-line environment.
Expected Result
You should see usage output similar to the following:
usage: java -jar GenomeAnalysisTK.jar -T <analysis_type> [-I <input_file>] [-L <intervals>] [-R <reference_sequence>] [-B <rodBind>] [-D <DBSNP>] [-H <hapmap>] [-hc <hapmap_chip>] [-o <out>] [-e <err>] [-oe <outerr>] [-A] [-M <maximum_reads>] [-sort <sort_on_the_fly>] [-compress <bam_compression>] [-fmq0] [-dfrac <downsample_to_fraction>] [-dcov <downsample_to_coverage>] [-S <validation_strictness>] [-U] [-P] [-dt] [-tblw] [-nt <numthreads>] [-l <logging_level>] [-log <log_to_file>] [-quiet] [-debug] [-h] -T,--analysis_type <analysis_type> Type of analysis to run -I,--input_file <input_file> SAM or BAM file(s) -L,--intervals <intervals> A list of genomic intervals over which to operate. Can be explicitly specified on the command line or in a file. -R,--reference_sequence <reference_sequence> Reference sequence file -B,--rodBind <rodBind> Bindings for reference-ordered data, in the form <name>,<type>,<file> -D,--DBSNP <DBSNP> DBSNP file -H,--hapmap <hapmap> Hapmap file -hc,--hapmap_chip <hapmap_chip> Hapmap chip file -o,--out <out> An output file presented to the walker. Will overwrite contents if file exists. -e,--err <err> An error output file presented to the walker. Will overwrite contents if file exists. -oe,--outerr <outerr> A joint file for 'normal' and error output presented to the walker. Will overwrite contents if file exists. ...
If you see this message, your GATK installation is ok. You're good to go! If you don't see this message, and instead get an error message, proceed to the next section on troubleshooting.
Let's try to figure out what's not working.
Action
First, make sure that your Java version is at least 1.7, by typing the following command:
java -version
Expected Result
You should see something similar to the following text:
java version "1.7.0_12" Java(TM) SE Runtime Environment (build 1.7.0_12-b04) Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
Remedial actions
If the version is less then 1.7, install the newest version of Java onto the system. If you instead see something like
java: Command not found
make sure that java is installed on your machine, and that your PATH variable contains the path to the java executables.
Updated on 2014-07-28
From donfreed on 2013-07-06
This article is a little out of date as GATK now requires java version 7.
[broadinstitute.org/gatk/guide/article?id=2846](http://www.broadinstitute.org/gatk/guide/article?id=2846)
If you an error like this:
Exception in thread “main” java.lang.UnsupportedClassVersionError: org/broadinstitute/sting/gatk/CommandLineGATK : Unsupported major.minor version 51.0
You’ll need to update to java 7
From Geraldine_VdAuwera on 2013-07-08
Indeed, that is correct. Thanks for reporting this, I’ll update the article accordingly.
From sarahh on 2013-08-02
when I typed Java -version I had the answer java version “1.6.0_51” but when I wanted to update Java on my Mac, the Java Control Panel tells me I have the up-to date version Java 7.25.
What should I do?
Thanks.
From Kurt on 2013-08-02
I have two Java versions going on since site wide, we have not made the transition to java 1.7. So my default is 1.6, but when I am using GATK 2.6+, I usually provide a full path (and just have it set as a variable in a shell script). e.g.
`JAVA_1_7=”/isilon/sequencing/Kurt/Programs/Java/jdk1.7.0_25/bin”`
`$JAVA_1_7/java -jar $GATK_DIR/GenomeAnalysisTK.jar …`
From Geraldine_VdAuwera on 2013-08-02
@sarahh, on MacOSX it seems that you have to install the latest JDK package from Sun (as opposed to just the JRE). It’s a pain, but blame Apple…
From sarahh on 2013-08-07
Ok, I did it and it indeed changed the version to 1.7.0_25, thank you very much Geraldine!
From hungstac on 2013-08-22
I have a Mac OSX 10.6.8 with JRE version 1.6.0_45. I tried to update to java 1.7, but according to the java website, Java 7 is not supported by versions of Mac OS X 10.6 or older. Does this mean I cannot run GATK on my computer? Thanks.
From Geraldine_VdAuwera on 2013-08-22
Hi @hungstac,
If you cannot upgrade your Mac OS version, that might be a problem. There are some workarounds for this such as [this one](http://timhooker.blogspot.com/2013/05/install-java-jdk7-on-mac-osx-snow.html) but I cannot give you any guarantees that it will work or that it is safe to do. Another workaround would be to install a virtual machine on your mac to emulate a different OS, but we can’t provide any guidance for that either. I would recommend asking your IT department for help with this issue.
From dfajar2 on 2013-11-15
Hi Geraldine, What if I have all the prerequisites installed to run GATK and still get an error. I am pastiing below the outputs to doublecheck they are installed.
$ java -version
java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b113) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b55, mixed mode)
$ bwa
Program: bwa (alignment via Burrows-Wheeler transformation) Version: 0.7.5a-r405 Contact: Heng Li lh3@sanger.ac.uk Usage: bwa [options] Command: index index sequences in the FASTA format mem BWA-MEM algorithm fastmap identify super-max ........
$ htscmd
Version: 0.0.1+ Usage: htscmd Commands: -- General and indexing tools: samview SAM<->BAM conv.........
$ samtools
Program: samtools (Tools for alignments in the SAM format) Version: 0.1.19-44428cd Usage: samtools [options] Command: view SAM<->BAM conversi............
$ java -jar /usr/local/bin/picard-tools-1.101/AddOrReplaceReadGroups.jar -h
Replaces all read groups in the INPUT file with a new read group and assigns all reads to this read group in the OUTPUT BAMVersion: 1.0 Version: 1.101(1580) Option....................
So everything looks good, but when I try to test GATK installation I get the following error:
$ java -jar GenomeAnalysisTK.jar --help
ERROR ------------------------------------------------------------------------------------------
ERROR stack trace
java.lang.ExceptionInInitializerError at org.broadinstitute.sting.gatk.GenomeAnalysisEngine.(GenomeAnalysisEngine.java:164) at org.broadinstitute.sting.gatk.CommandLineExecutable.(CommandLineExecutable.java:53) at org.broadinstitute.sting.gatk.CommandLineGATK.(CommandLineGATK.java:54) at org.broadinstitute.sting.gatk.CommandLineGATK.main(CommandLineGATK.java:90) Caused by: java.lang.NullPointerException at org.reflections.Reflections.scan(Reflections.java:220) at org.reflections.Reflections.scan(Reflections.java:166) at org.reflections.Reflections.(Reflections.java:94) at org.broadinstitute.sting.utils.classloader.PluginManager.(PluginManager.java:79) ... 4 more
ERROR ------------------------------------------------------------------------------------------
ERROR A GATK RUNTIME ERROR has occurred (version 2.5-2-gf57256b):
ERROR
ERROR Please check the documentation guide to see if this is a known problem
ERROR If not, please post the error, with stack trace, to the GATK forum
ERROR Visit our website and forum for extensive documentation and answers to
ERROR commonly asked questions http://www.broadinstitute.org/gatk
ERROR
ERROR MESSAGE: Code exception (see stack trace for error itself)
ERROR ------------------------------------------------------------------------------------------
What am I missing?
From Geraldine_VdAuwera on 2013-11-15
I think this is because you have Java 1.8 installed. The current version of GATK uses Java 1.7.
From dfajar2 on 2013-11-15
Ha!! You were right, now I get the help screen running it with 1.7. Well, i guess it is not always the best to have the latest versions of some software installed.
Thanks, I was turning myself crazy.
From azalea on 2014-02-26
Hi, maybe this is not the right place to ask, but I was wondering how I can download GATK from the command line. I need to install GATK on a server with no GUI. Thanks.
From Geraldine_VdAuwera on 2014-02-26
Hi @azalea,
That’s not currently possible, sorry. You’ll need to download it on a workstation with a GUI then transfer it over your network to your server.
From egeulgen on 2014-04-08
Hey @dfajar2 I’ve got to same problem. How did you work around it? uninstall 1.8 and 1.7?
> @dfajar2 said:
> Ha!! You were right, now I get the help screen running it with 1.7. Well, i guess it is not always the best to have the latest versions of some software installed.
>
> Thanks, I was turning myself crazy.
From egeulgen on 2014-04-08
dfajar2 nevermind, I figured it out >
egeulgen said:
> Hey dfajar2 I’ve got to same problem. How did you work around it? uninstall 1.8 and 1.7?
>
> > Thanks, I was turning myself crazy.
From iqbal on 2014-04-28
Hi, I have installed the java 1.7 but it still shows the older version in my mac os 10.9.2, can you help?
From iqbal on 2014-04-28
well, i have found the solution to my problem…
From cgarner4 on 2014-05-07
Hello :o)
I understand that the article is a bit outdated so I may not get the same out put shown in the example. What I am getting seems very similar but I am concerned about the error in the first line:
Error: -jar requires jar file specification
Usage: java [-options] class [args…] (to execute a class) or java [-options] -jar jarfile [args…] (to execute a jar file)
where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the “server” VM The default VM is server, because you are running on a server-class machine.
-cp -classpath A : separated list of directories, JAR archives, and ZIP archives to search for class files. -D= set a system property -verbose:[class|gc|jni] enable verbose output -version print product version and exit -version: require the specified version to run -showversion print product version and continue -jre-restrict-search | -no-jre-restrict-search include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:…|:] -enableassertions[:…|:] enable assertions with specified granularity -da[:…|:] -disableassertions[:…|:] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:[=] load native agent library , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:[=] load native agent library by full pathname -javaagent:[=] load Java programming language agent, see java.lang.instrument -splash: show splash screen with specified image See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Can anyone offer feedback on this? Thanks,, in advance!
From Geraldine_VdAuwera on 2014-05-12
@cgarner4 It sounds like you forgot to specify the -jar file in your command… See the basic GATK command line structure in the docs.
From filipzembol on 2014-07-15
Hi I would like to install new version of GATK. I download it and unpack it. after that I used: `java -jar GenomeAnalysisTK.jar —help `
An I received: Exception in thread “main” java.lang.UnsupportedClassVersionError: org/broadinstitute/gatk/engine/CommandLineGATK : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) Could not find the main class: org.broadinstitute.gatk.engine.CommandLineGATK. Program will exit.
Please could you help me where is the problem?
From thibault on 2014-07-15
Unfortunately this is a Java error so we can’t control this confusing message.
What it means is that you need to upgrade to Java 7 (also known as Java 1.7).
From hypotheses on 2015-04-23
Just got the same problem “Could not find the main class: org.broadinstitute.gatk.engine.CommandLineGATK.“
on an older system running Ubuntu 12.0.04.5 LTS with openjdk-6
If it’s still relevant to anyone, updating to openjdk-7-jre should probably work, but you will need the (openjdk-7-jdk) as well. I probably missed the instruction somewhere on the GATK download page, when I downloaded GATK3.30 recently.
From Geraldine_VdAuwera on 2015-04-23
As documented in the FAQ on software requirements, recent versions of GATK require Java 7 / 1.7
From addseo1118 on 2015-04-28
Many thanks!
From thibault on 2015-04-30
In addition, we only support Oracle’s Java as opposed to OpenJDK.
From wacguy on 2015-12-10
Trying to check picard (java -jar ./picard.jar -h) but keep on receivig the following error:
Exception in thread “main” java.lang.UnsupportedClassVersionError: picard/cmdline/PicardCommandLine : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
my setting:
java version “1.7.0_71“
OpenJDK Runtime Environment (rhel-2.5.3.1.el6-x86_64 u71-b14)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
server: Censos 6.6
Any Ideas?
Yhanks a lot,
Guy
From Sheila on 2015-12-11
@wacguy
Hi Guy,
The latest version of Picard uses Java 1.8.
-Sheila
From rasmu23 on 2016-07-11
@Geraldine_VdAuwera Hello, I am having this error: Exception in thread “main” java.lang.UnsupportedClassVersionError: org/broadinstitute/gatk/engine/CommandLineGATK : Unsupported major.minor version 52.0.
when I run java -version I get this: java version “1.7.0_80” and javac : javac 1.7.0_80. I am currently running ubuntu 12.04. All of posts i’ve read have said to update to java 7, but that’s the version I have. Any suggestions would be greatly appreciated. Thanks
From Geraldine_VdAuwera on 2016-07-12
Hi @rasmu23, the Java version requirement was increased to 1.8 for GATK 3.6, as noted in the [quick start documentation](https://www.broadinstitute.org/gatk/documentation/quickstart).
From asallam on 2016-08-03
Hi, I ran this command, and got the following error:
Error: -jar requires jar file specification
Usage: java [-options] class [args…] (to execute a class) or java [-options] -jar jarfile [args…] (to execute a jar file)
where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the “server” VM The default VM is server, because you are running on a server-class machine.
-cp -classpath A : separated list of directories, JAR archives, and ZIP archives to search for class files. -D= set a system property -verbose:[class|gc|jni] enable verbose output -version print product version and exit -version: Warning: this feature is deprecated and will be removed in a future release. require the specified version to run -showversion print product version and continue -jre-restrict-search | -no-jre-restrict-search Warning: this feature is deprecated and will be removed in a future release. include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:…|:] -enableassertions[:…|:] enable assertions with specified granularity -da[:…|:] -disableassertions[:…|:] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:[=] load native agent library , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:[=] load native agent library by full pathname -javaagent:[=] load Java programming language agent, see java.lang.instrument -splash: show splash screen with specified image See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
any tips on how to get the correct readout?
From Sheila on 2016-08-04
@asallam
Hi
I did not see the exact command you ran. Did you download the latest version of GATK? Are you running on Oracle JDK?
Thanks,
Sheila
From asallam on 2016-08-04
@Sheila I ran the following code: Aminahs-MacBook-Air:~ aminahsallam$ java -jar —help
I downloaded the latest version of GATK and oracle JDK
-Aminah
From Sheila on 2016-08-05
@asallam
Hi Aminah,
What version of Java are you using?
-Sheila
From pdexheimer on 2016-08-05
@asallam – You’re not literally enclosing the name of the jar in angle brackets (<>) are you? That’s simply a device to highlight a block you should fill in correctly, you should not retain the brackets
From asallam on 2016-08-05
@pdexheimer my mistake in copying, but I’m not enclosing the name of the jar in angle brackets. error still occurs.
@Sheila I’m using Java 1.8 …. I know GATK was meant for Java 1.7 but other tutorials have been working for me besides this one
From nkaspric on 2016-10-10
Hello,
I have a problem to run GATK. It is perfectly running on my macbook, but when I try to run it on my server nothing happens.
Java version is 1.8.0_74, I download GATK 3.6 and when i use : java -jar GenomeAnalysisTK.jar -h nothing happens and command run without output on the terminal.
If anyone has already got this issue, please let me know if there is a solution :neutral:
Nicolas
From Sheila on 2016-10-13
@nkaspric
Hi Nicolas,
Hmm. I am not sure if we can help with that. You may want to check with your IT department to see if everything is installed properly.
-Sheila
From tanu06 on 2017-02-28
Hi,
I have have
java version “1.8.0_121“
Java™ SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot™ 64-Bit Server VM (build 25.121-b13, mixed mode) and i am getting the below error when running BQSR on GATK.
Exception in thread “main” java.lang.ExceptionInInitializerError at org.broadinstitute.sting.gatk.GenomeAnalysisEngine.(GenomeAnalysisEngine.java:144) at org.broadinstitute.sting.gatk.CommandLineExecutable.(CommandLineExecutable.java:58) at org.broadinstitute.sting.gatk.CommandLineGATK.(CommandLineGATK.java:50) at org.broadinstitute.sting.gatk.CommandLineGATK.main(CommandLineGATK.java:86)
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: could not create class file from Accessible.class at org.reflections.Reflections.scan(Reflections.java:166) at org.reflections.Reflections.(Reflections.java:91) at org.broadinstitute.sting.utils.classloader.PluginManager.(PluginManager.java:59) … 4 more
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: could not create class file from Accessible.class at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.reflections.Reflections.scan(Reflections.java:162) … 6 more
Caused by: java.lang.RuntimeException: could not create class file from Accessible.class at org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:41) at org.reflections.Reflections$2.run(Reflections.java:149) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: invalid constant type: 18 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1023) at javassist.bytecode.ConstPool.read(ConstPool.java:966) at javassist.bytecode.ConstPool.(ConstPool.java:127) at javassist.bytecode.ClassFile.read(ClassFile.java:693) at javassist.bytecode.ClassFile.(ClassFile.java:85) at org.reflections.adapters.JavassistAdapter.createClassObject(JavassistAdapter.java:86) at org.reflections.adapters.JavassistAdapter.createClassObject(JavassistAdapter.java:22) at org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:38) … 6 more
Tanushree
From Geraldine_VdAuwera on 2017-02-28
@tanu06 You seem to be running an old version of GATK (I can tell because the classpaths in the error say “sting”, which was phased out in 3.1 iirc), so you should probably use Java 7 instead.
From amr@broadinstitute.orge on 2017-03-17
@Geraldine_VdAuwera is it correct to say that GATK does not support working on Java 8 then?
From Geraldine_VdAuwera on 2017-03-17
amr
broadinstitute.orge No, the current supported version of GATK runs on Java 8. It’s versions older than 3.6 that do not.
From wjz20 on 2017-05-05
-
From Deepa_Krishna on 2017-05-23
Hi,
I have installed new version of GATK, and the java version is 1.7
But still getting this error….
Exception in thread “main” java.lang.UnsupportedClassVersionError: org/broadinstitute/gatk/engine/CommandLineGATK : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:803) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
From Sheila on 2017-05-25
@Deepa_Krishna
Hi,
The newest version requires Java 1.8
-Sheila