# Kneaddata trimmomatic demo java error

**URL:** <https://forum.biobakery.org/t/kneaddata-trimmomatic-demo-java-error/2894>\
**Category:** KneadData\
**Created:** [December 12, 2021, 8:03pm UTC](https://forum.biobakery.org/t/kneaddata-trimmomatic-demo-java-error/2894 "2021-12-12T20:03:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnoldhk](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@arnoldhk](https://forum.biobakery.org/u/arnoldhk)\
**Post date:** [December 12, 2021, 8:03pm UTC](https://forum.biobakery.org/t/kneaddata-trimmomatic-demo-java-error/2894/1 "2021-12-12T20:03:48Z")

</div>

Hello,

In short, I believe the java version provided by the conda channel for kneadData is not correctly being called by the trimmomatic command. I posted under a GitHub issue that was opened already. My post is by arnold3. Here is the link to the GitHub discussion, and I copy pasted my post below the link in case that is most helpful. Thanks for any information you can provide.

> <https://github.com/bioconda/bioconda-recipes/issues/18666>
>
> Hi,
> 
> I just installed Kneaddata 0.7.3 into an empty Conda environment. 
> 
> Run…ning a short demo using data provided by the tool authors:
> 
> \`kneaddata -db examples/demo\_db -i examples/demo.fastq -o out\`
> 
> yields:
> 
> \> ERROR: Unable to find trimmomatic. Please provide the full path to trimmomatic with --trimmomatic.
> 
> Trying:
> \`kneaddata -db examples/demo\_db -i examples/demo.fastq -o out --trimmomatic /ifs/data/nfs\_share/sukmb352/conda/metagenomics-devel/bin/trimmomatic\`
> 
> yields:
> 
> \> ERROR: Unable to list files in trimmomatic directory: /ifs/data/nfs\_share/sukmb352/conda/metagenomics-devel/bin/trimmomatic
> 
> Trying:
> \`kneaddata -db examples/demo\_db -i examples/demo.fastq -o out --trimmomatic /ifs/data/nfs\_share/sukmb352/conda/metagenomics-devel/bin/\`
> 
> yields:
> 
> \> ERROR: The trimmomatic\*.jar executable is not included in the directory: /ifs/data/nfs\_share/sukmb352/conda/metagenomics-devel/bin
> 
> How is this then supposed to work, exactly?

Hi All, Trying to make a reproducible example here. I am having a similar problem.

I downloaded installed kneaddata via conda:

`conda install -c bioconda kneaddata`

and downloaded the tutorial files here

`https://huttenhower.sph.harvard.edu/kneaddata/`

Running this command, I get an error that trimmomatic is not able to be found

`$ kneaddata --input input/singleEnd.fastq --reference-db input/demo_db --output kneaddataOutputSingleEnd `

`ERROR: Unable to find trimmomatic. Please provide the full path to trimmomatic with --trimmomatic. `

As noted above, within conda, the trimmomatic is a link that points to the shared folder. Specifying the direct link to where the trimmomatic.jar is with the following command

`kneaddata --input input/seq1.fastq --input input/seq2.fastq --reference-db input/demo_db --output kneaddataOutputPairedEnd --trimmomatic ../share/trimmomatic-0.39-2/ `

runs trimmomatdc but yields a different error:

`Initial number of reads ( ~/input/seq1.fastq ): 42473 Initial number of reads ( ~/input/seq2.fastq ): 42473 Running Trimmomatic ...`

`CRITICAL ERROR: Error executing: java -Xmx500m -d64 -jar ~/share/trimmomatic-0.39-2/trimmomatic.jar PE -threads 1 -phred33 ~/input/seq1.fastq ~/input/seq2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.1.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.1.fastq ~/kneaddataTutorial/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.2.fastq SLIDINGWINDOW:4:20 MINLEN:122`

`Error message returned from Trimmomatic : Unrecognized option: -d64 Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. `

When I copy and paste just the java code, the same message results:  
`java -Xmx500m -d64 -jar ~/share/trimmomatic-0.39-2/trimmomatic.jar PE -threads 1 -phred33 ~/input/seq1.fastq ~/input/seq2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.1.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.1.fastq ~/kneaddataTutorial/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.2.fastq SLIDINGWINDOW:4:20 MINLEN:122`

But if I remove the `-d64` and rerun, the program completes  
`java -Xmx500m -jar ~/share/trimmomatic-0.39-2/trimmomatic.jar PE -threads 1 -phred33 ~/input/seq1.fastq ~/input/seq2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.1.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.1.fastq ~/kneaddataTutorial/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.2.fastq ~/kneaddataOutputPairedEnd/seq1_kneaddata.trimmed.single.2.fastq SLIDINGWINDOW:4:20 MINLEN:122`

`TrimmomaticPE: Completed Successfully`

However, this presents the problem that then the rest of the workflow for kneaddata is not run. I tried checking to see if perhaps I have the wrong version of java installed. The URL link is broken (#4 Java runtime environment link listed here: [KneadData – The Huttenhower Lab](https://huttenhower.sph.harvard.edu/kneaddata/)) to kneaddata’s required java runtime environment.

`java --version openjdk 10.0.2 2018-07-17 OpenJDK Runtime Environment Zulu10.3+5 (build 10.0.2+13) OpenJDK 64-Bit Server VM Zulu10.3+5 (build 10.0.2+13, mixed mode)`

Any suggestions on how to move forward are greatly appreciated!
