Bug Bulletin: The recent 3.2 release fixes many issues. If you run into a problem, please try the latest version before posting a bug report, as your problem may already have been solved.

Java version with QUEUE.

userNameuserName Posts: 11Member
edited October 2013 in Ask the GATK team

Hi team,

I have Java 1.6 installed in my system. I know that GATK works now with Java 1.7, but I work in a shared system and I can not change the default java version so I downloaded Java 1.7 and I work asigning the java version at the call:

If I run:

/jre1.7.0/bin/java -Djava.io.tmpdir=tmp -jar Queue.jar --help

works fine, but if I try:

/jre1.7.0/bin/java -Djava.io.tmpdir=tmp -jar Queue.jar -S myScala.file ....

I get the following error:

DEBUG 13:42:50,953 FunctionEdge - Starting: /Qscripts > 'java' '-Xmx2048m' '-XX:+UseParallelOldGC' '-XX:ParallelGCThreads=4' '-XX:GCTimeLimit=50' '-XX:GCHeapFreeLimit=10' '-Djava.io.tmpdir=/Qscripts/tmp' '-cp' 'Queue.jar' 'org.broadinstitute.sting.gatk.CommandLineGATK' '-T' 'HaplotypeCaller' '-I' '/resources/exampleBAM.bam' '-R' '/resources/exampleFASTA.fasta' '-nct' '1' '-o' '/raw1.vcf' '-hets' '0.005'

INFO 13:42:50,954 FunctionEdge - Output written to /raw1.vcf.out
DEBUG 13:42:50,954 IOUtils - Deleted /raw1.vcf.out
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/broadinstitute/sting/gatk/CommandLineGATK : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.broadinstitute.sting.gatk.CommandLineGATK. Program will exit.

Seems like if HaplotypeCaller call java again and use the default java in the system, that is Java 1.6

Can I change the "java" version parameter?

Thanks in advance,

Post edited by userName on
Tagged:

Best Answer

Answers

  • pdexheimerpdexheimer Posts: 322Member, GSA Collaborator ✭✭✭

    What if you manipulate your PATH environment variable? Put the 1.7 JRE first, and maybe even remove the entry for 1.6. It's also pretty hack-ish, but might be simpler than rebuilding Queue

  • userNameuserName Posts: 11Member
    edited October 2013

    Thank you very much for your answers, Johan and pdexheimer. Finally I have solved it.

    First, I tried with the pdexheimer way. I add the jre 1.7 to PATH variable and bashrc so if I did:

    $: java -version

    The output: "java version "1.7.0"" (instead java version "1.6.0")

    and for:

    $: which java

    I obtained: "myPath/jre1.7.0/bin"

    I thought that I had solved the problem but when I tried:

    $: java -Djava.io.tmpdir=tmp -jar Queue.jar -S myScala.file ....

    I get the version java error (Exception in thread "main" java.lang.UnsupportedClassVersionError: org/broadinstitute/sting/gatk/CommandLineGATK : Unsupported major.minor version 51.0). I'm not sure why...

    So I tried the Johan solution. I found where the call was:

    gatk-protected-master/public/scala/src/org/broadinstitute/sting/queue/function/JavaCommandLineFunction.scala

    I just change : "def commandLine = required("java") + javaOpts + javaExecutable" by

    "def commandLine = required("/myApps/jre1.7.0/bin/java") + javaOpts + javaExecutable"

    I rebuilded Queue and now is working fine.

    Regards,

    Post edited by userName on
Sign In or Register to comment.