Question: Error: Could not find or load main class -Xmx4g
0
gravatar for Adriel Rosa
4 months ago by
Brasil
Adriel Rosa0 wrote:

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 xmx4g gatk haplotypecaller • 226 views
ADD COMMENTlink modified 5 days ago by larryhems0 • written 4 months ago by Adriel Rosa0

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

ADD REPLYlink written 4 months ago by RamRS30k

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

ADD REPLYlink written 4 months ago by brunobsouzaa260

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 REPLYlink modified 4 months ago • written 4 months ago by RamRS30k

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 REPLYlink written 4 months ago by brunobsouzaa260

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 REPLYlink written 4 months ago by RamRS30k
0
gravatar for RamRS
4 months ago by
RamRS30k
Baylor College of Medicine, Houston, TX
RamRS30k wrote:

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 COMMENTlink written 4 months ago by RamRS30k

thank you for help me

ADD REPLYlink written 4 months ago by Adriel Rosa0

Did it work? Did it solve your problem?

ADD REPLYlink written 4 months ago by RamRS30k
0
gravatar for larryhems
5 days ago by
larryhems0
larryhems0 wrote:

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 COMMENTlink written 5 days ago by larryhems0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1568 users visited in the last hour