We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!
Test-drive the GATK tools and Best Practices pipelines on Terra
Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
(howto) Test your GATK installation

Objective
Test that the GATK is correctly installed, and that the supporting tools like Java are in your path.
Prerequisites
- Basic familiarity with the command-line environment
- Understand what is a PATH variable
- GATK downloaded and placed on path
Steps
- Invoke the GATK usage/help message
- Troubleshooting
1. Invoke the GATK usage/help message
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.
2. 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.
Comments
This article is a little out of date as GATK now requires java version 7.
broadinstitute.org/gatk/guide/article?id=2846
If you an error like this:
You'll need to update to java 7
Indeed, that is correct. Thanks for reporting this, I'll update the article accordingly.
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.
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 ...
@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...
Ok, I did it and it indeed changed the version to 1.7.0_25, thank you very much Geraldine!
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.
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 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.
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.
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?
I think this is because you have Java 1.8 installed. The current version of GATK uses Java 1.7.
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.
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.
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.
Hey @dfajar2 I've got to same problem. How did you work around it? uninstall 1.8 and 1.7?
@dfajar2 nevermind, I figured it out
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?
well, i have found the solution to my problem...
Hello
)
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.
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Can anyone offer feedback on this? Thanks,, in advance!
@cgarner4 It sounds like you forgot to specify the -jar file in your command... See the basic GATK command line structure in the docs.
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?
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).
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.
As documented in the FAQ on software requirements, recent versions of GATK require Java 7 / 1.7
Many thanks!
In addition, we only support Oracle's Java as opposed to OpenJDK.
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
@wacguy
Hi Guy,
The latest version of Picard uses Java 1.8.
-Sheila
@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
Hi @rasmu23, the Java version requirement was increased to 1.8 for GATK 3.6, as noted in the quick start documentation.
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.
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
any tips on how to get the correct readout?
@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
@Sheila I ran the following code: Aminahs-MacBook-Air:~ aminahsallam$ java -jar </users/aminahsallam/GenomeAnalysisTK.jar> --help
I downloaded the latest version of GATK and oracle JDK
-Aminah
@asallam
Hi Aminah,
What version of Java are you using?
-Sheila
@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
@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
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
Nicolas
@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
Hi,
I have have
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 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
@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.
@Geraldine_VdAuwera is it correct to say that GATK does not support working on Java 8 then?
@[email protected].orge No, the current supported version of GATK runs on Java 8. It's versions older than 3.6 that do not.
-
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)
@Deepa_Krishna
Hi,
The newest version requires Java 1.8
-Sheila