Error: Could not find or load main class -Xmx4g
2
0
Entering edit mode
4.6 years ago

Hello, I had some problem with gatk haplotypecaller, someone can help me? thats the error:

Error:  Could not find or load main class “-Xmx4g”

my command:

./gatk --java-options “-Xmx4g” HaplotypeCaller -R /home/adriel-rosa/STARteste/referência/Oreochromis_niloticus.O_niloticus_UMD_NMBU.dna.toplevel.fa -I /home/adriel-rosa/STARteste/Alinhamento/T1R2_6H/out/BAM/T1R2_6H.out.bam -O /home/adriel-rosa/STARteste/Gatk/T1R2_6H_out.g.vcf.gz -ERC GVCF

the complete message:

(base) adriel-rosa@mendel-main:~/gatk-4.1.4.1$ ./gatk --java-options “-Xmx4g” HaplotypeCaller -R /home/adriel-rosa/STARteste/referência/Oreochromis_niloticus.O_niloticus_UMD_NMBU.dna.toplevel.fa -I /home/adriel-rosa/STARteste/Alinhamento/T1R2_6H/out/BAM/T1R2_6H.out.bam -O /home/adriel-rosa/STARteste/Gatk/T1R2_6H_out.g.vcf.gz -ERC GVCF
Using GATK jar /home/adriel-rosa/gatk-4.1.4.1/gatk-package-4.1.4.1-local.jar
Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 “-Xmx4g” -jar /home/adriel-rosa/gatk-4.1.4.1/gatk-package-4.1.4.1-local.jar HaplotypeCaller -R /home/adriel-rosa/STARteste/referência/Oreochromis_niloticus.O_niloticus_UMD_NMBU.dna.toplevel.fa -I /home/adriel-rosa/STARteste/Alinhamento/T1R2_6H/out/BAM/T1R2_6H.out.bam -O /home/adriel-rosa/STARteste/Gatk/T1R2_6H_out.g.vcf.gz -ERC GVCF
Error: Could not find or load main class “-Xmx4g”
SNP gatk Xmx4g haplotypecaller • 4.7k views
ADD COMMENT
0
Entering edit mode

This is a Question type, post, not a Tool type post. Please read the posts under the how to tag for more information.

ADD REPLY
0
Entering edit mode

You should use java -jar -Xmx4G /path/to/GATK.jar

ADD REPLY
0
Entering edit mode

Did you read the readme? It has the exact usage OP has used here, so there is no problem with their syntax.

Please stop adding answers that don't answer the top level question. If you are even mildly unsure, use Comments instead of Answers.

ADD REPLY
0
Entering edit mode

Yes, I have read the readme file... Also noticed that OP is starting into this kind of analysis. I'm not saying that his syntax is wrong, just gave him an alternative option to realize that he can run GATK without CD into the tool folder or include the file into his $PATH

ADD REPLY
0
Entering edit mode

Sure, using the other syntax is an option, but the phrasing "you should" instead of "Another option is" sounds like this is the recommended way to do things, which is not true.

ADD REPLY
0
Entering edit mode
4.6 years ago
Ram 44k

I think you've copy-pasted this command from a PDF document or Word document, which is why your double quotes are formatted specially. Try typing in the command instead of copy-pasting it.

ADD COMMENT
0
Entering edit mode

thank you for help me

ADD REPLY
0
Entering edit mode

Did it work? Did it solve your problem?

ADD REPLY
0
Entering edit mode
4.2 years ago
larryhems • 0

While executing, when JVM does not find a .class file with the specified name then a run time error occurs saying “Could not found or load main class”. The reason why this happens is mostly due to:

  • Wrong Class Name
  • Invalid Classpath

Main class could not be found when there is typo or wrong syntax in the fully qualified java class name or it does not exist in the provided classpath. You must ensure that you add the location of your .class file to your classpath. So, if its in the current folder, add . to your classpath. Note that the Windows classpath separator is a semi-colon ; . If you want to execute the main() method in MainClass, you must use the full class name, including package name, in the java command.

ADD COMMENT

Login before adding your answer.

Traffic: 1830 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6