We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Unable to run SVPreprocess. Java cannot find the main class


I'm sure this is obvious but I can't seem to find my bug. I have been trying to execute the commands as listed in the documentation for our data but I am thwarted at every turn.

Here are the steps I have taken.
1) Download and decompress the latest-n-greatest release of genomeStrip (svtoolkit_2.00.1774.tar.gz)

2) Ensure that the java classpath includes the genomeSTRiP directory and the necessary dependencies.

export GS=$HOME/apps/svtoolkit
export CLASSPATH=".:$GS/lib:$GS/lib/depend:$GS/lib/gatk:$GS/lib/SVToolkit.jar:$GS/lib/gatk/Queue.jar"

3) Execute the SVPreprocess command

java -Xmx8g -cp $CLASSPATH org.broadinstitute.gatk.queue.QCommandLine \
  -S $GS/qscript/SVPreprocess.q \
  -S $GS/qscript/SVQScript.q \
  -cp $CLASSPATH \
  -gatk GenomeAnalysisTK.jar \
  -configFile $GS/conf/genstrip_parameters.txt \
  -R /data/hs37d5.fa \
  -tempDir /tmp \
  -md metadata \
  -genomeMaskFile $HOME/apps/masks/Homo_sapiens_assembly19.mask.101.fasta \
  -genderMapFile $GS/conf/gf48_gender.tab \
  -I $HOME/data/align.2017-12-14/bams/SAFID_abc1.recal.bam

I continue to get this error message:
Error: Could not find or load main class org.broadinstitute.gatk.queue.QCommandLine

I'm not sure what I'm doing wrong here.
Can anyone help me out?


Best Answer


  • bhandsakerbhandsaker Member, Broadie ✭✭✭✭

    I have always found this to be one of the hardest things to debug when using java - there is little to point you to what the underlying problem is.

    I don't think your classpath is right. I use just:
    export SV_CLASSPATH="${SV_DIR}/lib/SVToolkit.jar:${SV_DIR}/lib/gatk/GenomeAnalysisTK.jar"
    java -cp ${SV_CLASSPATH} ...
    and this works fine for me. You can also test by removing all of the other arguments, then ensure you are getting past loading the main class (you will get an error about missing required arguments).

  • dfermindfermin USMember
    Accepted Answer

    Thanks bhandsaker! That seems to have worked for me.
    Don't really understand what I was doing wrong but using your classpath string worked for me after I set $SV_DIR

  • bhandsakerbhandsaker Member, Broadie ✭✭✭✭

    Glad it worked.
    The main problem was that you didn't have GenomeAnalysisTK.jar on the classpath.

  • dfermindfermin USMember

    That's what I didn't get I guess. I specified the path where that jar lived and assumed java would "see it".

Sign In or Register to comment.