This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SnpEff annotation keeps throwing Java Errors

So I keep running the following code.

snpEffBuildAndRun --snpeff-exec /home/treinbo/snpEff/snpEff.jar KMM.gff 6_KMM7_Chloroplast_freebayes_07012019.vcf -o 7_KMM7_chloroplast_annotate.vcf

And it keeps giving me the following error.

Traceback (most recent call last):
  File "/home/treinbo/anaconda3/bin/snpEffBuildAndRun", line 44, in <module>
    args = check_and_amend_executables(args)
  File "/home/treinbo/anaconda3/lib/python3.7/site-packages/snpEffWrapper/wrapper.py", line 79, in check_and_amend_executables
    args.java_exec = _choose_java()
  File "/home/treinbo/anaconda3/lib/python3.7/site-packages/snpEffWrapper/wrapper.py", line 59, in _choose_java
    if _java_version_ok(java):
  File "/home/treinbo/anaconda3/lib/python3.7/site-packages/snpEffWrapper/wrapper.py", line 43, in _java_version_ok
    output = subprocess.check_output([java, '-Xmx10m', '-version'], stderr=subprocess.STDOUT)
  File "/home/treinbo/anaconda3/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/home/treinbo/anaconda3/lib/python3.7/subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/treinbo/anaconda3/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/home/treinbo/anaconda3/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/software/bin/java': '/software/bin/java'

Java is installed, and I've typed Java into terminal and got results, so it definitely is working, so why is it trying to find a version of java that doesn't exist?

Thank you guys so much!!

assembly genome assembly snp snp

What is the result of which java? And echo $JAVA_HOME?

1 answer

Set the path of Java installation using --java-exec option.

That worked! thank you!!

If the answer solved your problem, then please up-vote it and toggle the accepted flag.

Log in to answer this question.