The current GATK version is 3.7-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Get notifications!

You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Did you remember to?

1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?

Then follow instructions in Article#1894.

Formatting tip!

Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Picard 2.9.0 is now available. Download and read release notes here.
GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.

java conflict on cluster

BlueBlue Posts: 48
edited June 2013 in Ask the GATK team


I'm getting repeated errors relating to java, when using GATK in a shell script on my university cluster. The message is 'NoClassDefFoundError'. It has worked previously using GATK version 2.1.9 (on a different node). My memory allocation for GATK on the cluster is set to 16GB. As I'm using GATK as part of a shell script which invokes java, then the 'java', '-2xmg' and '.jar' parts of the command are not required (at least they weren't previously). Attempting to invoke GATK from the command line in cluster using -bash: /cm/shared/apps/GenomeAnalysisTK/2.1.9/GenomeAnalysisTK.jar ...returns :Permission denied

The first question is 'am I coding it correctly?', the second is 'could GATK not be happy with java?' and the third is 'do you have any tips to resolve this?'

I have read the several of the answers relating to java-GATK problems but am none the wiser. Any help would be most appreciated.



The shell script commands are:

#$ -N ReadMapper_H001
#$ -S /bin/sh 
    # Reference file IO (.e and .o files) to the current working directory 
#$ -cwd 
#Merge the standard out and standard error to one file 
#$ -j y 
#Use the bioinf.q 
#$ -q bioinf.q 
. /etc/profile.d/ 

# Load modules 
module load bio/1.15 gatk/2.4.9 jdk/1.6.0_24 picard-tools/1.77 R/2.14.0

# All the other stuff (scythe, sickle, bwa, picard etc for cleaning, read mapping etc)

# Identify indels from reference genome
GenomeAnalysisTK \
    -I /mnt/lustre/scratch/bioenv/wg39/tmp/lhm_read_mapping/H001/H001_CRSN.bam \
    -R /home/w/wg/wg39/accessory_data_130613/Dmel_ref_seqs_051112/dmel-all-chromosome-r5.9.fasta \
    -T RealignerTargetCreator \
    -o /mnt/lustre/scratch/bioenv/wg39/tmp/lhm_read_mapping/H001/H001_realignment.intervals \

The error message is:

Exception in thread "main" java.lang.NoClassDefFoundError: java
Caused by: java.lang.ClassNotFoundException: java
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
Could not find the main class: java.  Program will exit.
Post edited by Geraldine_VdAuwera on

Best Answer


  • BlueBlue Posts: 48

    PS Apologies for the weird font in the above message.

  • WimSWimS Posts: 27

    Are you running the latest version of GATK (2.6.3)? If so make sure that all your nodes run java 7. Execute java -version on all nodes to see the version. The output of that should be :

    java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

  • BlueBlue Posts: 48

    Hi Wim,

    Thanks for your response. I've been running GATK 2.4.9 and Java 1.6_24-b07. I'm specifying which version of Java to use, at the beginning of the shell script. The reason for this was that even if the default cluster version of Java changes as I sequence more samples, the version for the analysis pipeline remains constant. In reality this might not be so practical.

    I've tried running the script without specifying which Java version to use and the same error message is returned.

    I'm getting GATK 2.6.3 installed. I'll have to check with IT about the java version.

    So, I'm now assuming that the problem is caused by outdated version of Java.

    Cheers anyway, I'll post the outcome,


  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAPosts: 11,743 admin

    Yes, starting with release 2.6 the GATK now requires Java 1.7. The announcement was delayed but will go out by noon today (EST). We'll also update all relevant documentation asap.

    Geraldine Van der Auwera, PhD

  • BlueBlue Posts: 48

    Having updated GATK and Java, my script was still failing at the GATK commands. Under the suspicion that this was caused by conflict with another Java-based program (probably an older version of Picard), I specified for program modules to be loaded and unloaded only at the relevant stages in the processing pipeline, and not to load all at the beginning of the script (for which they had previously worked before the updates). Anyway this works. I'm not sure if I'd have to separate out Picard and GATK loading and unloading if Picard was a recent version. Frequent upgrades are a pain in the terminal abdominal segment.

  • gokmenzgokmenz ShenzhenPosts: 1
    edited August 2013

    Hey Blue, did you solve the problem? I am also meeting with a similar problem in IndelRealigner part. I hava Java 1.7 and tried different versions of GATK but still hava problem.

    Here is my scripts:

    gokmen@gokmen-MacBookPro:~/Desktop/Denemeler/GATK_VariantCalling/03.InDelRealignment$ java -Xmx1g –jar 01.bin/GenomeAnalysisTK.jar
    –T IndelRealigner
    –R ../00.RawData/reference.fa
    –I ../02.Mapping/sample1_RG.bam
    – ../00.RawData/Mills_and_1000G_gold_standard.indels.hg19.vcf
    – targetIntervals realigner.intervals
    –o realigned.bam

    Error: Could not find or load main class –jar

    Here is my Java version:

    Java 1.7 java version "1.7.0_25"
    Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
    Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAPosts: 11,743 admin

    Are you by any chance building from source and then moving the jar to a different location? With the basic build target this won't work because it doesn't generate a full packaged jar. But we can give you instructions to do so if you need that.

    If you're using the precompiled binary then I have no idea what's going on.

    Geraldine Van der Auwera, PhD

  • mpw6mpw6 Posts: 10

    Hi, was this resolved? I'm having a similar problem:

    [mpw6@compute-10-15 gatk]$ java /home/mpw6/GenomeAnalysisTK-2.7-2-g6bda569/GenomeAnalysisTK.jar -T RealignerTargetCreator -R human_g1k_v37.fasta -I F03-03.sorted.nodup.bam -known 1000G_phase1.indels.hg19.vcf -o F03-03.intervals.list

    Error: Could not find or load main class .home.mpw6.GenomeAnalysisTK-2.7-2-g6bda569.GenomeAnalysisTK.jar

    [mpw6@compute-10-15 gatk]$ java -version

    java version "1.7.0_03"
    Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

    I downloaded the jar. It's not built from source.

  • mpw6mpw6 Posts: 10

    Never mind. I forgot the -jar flag.

Sign In or Register to comment.