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!

Powered by Vanilla. Made with Bootstrap.
GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.
Register now for the upcoming GATK Best Practices workshop, Feb 20-22 in Leuven, Belgium. Open to all comers! More info and signup at

java conflict on cluster

BlueBlue Member 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 Member Posts: 48

    PS Apologies for the weird font in the above message.

  • WimSWimS Member 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 Member 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 Administrator, Dev Posts: 10,993 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 Member 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 ShenzhenMember Posts: 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 Administrator, Dev Posts: 10,993 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 Member 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 Member Posts: 10

    Never mind. I forgot the -jar flag.

Sign In or Register to comment.