Q: "java: command not found"
When submitting jobs to your on-prem HPC (regardless of whether using SSH or Tower-Agent authentication), the following error may appear in your Nextflow logs even though you have Java on your $PATH environment variable:
java: command not found Nextflow is trying to use the Java VM defined for the following environment variables: JAVA_CMD: java NXF_OPTS:
Possible reasons for this error:
- The queue where the Nextflow head job runs is in a different environment/node than your login node userspace.
- If your HPC cluster uses modules, the Java module may not be loaded by default.
To troubleshoot:
- Open an interactive session with the head job queue.
- Launch the Nextflow job from the interactive session.
- If you cluster uses modules:
- Add
module load <your_java_module>
in the Advanced Features > Pre-run script field when creating your HPC compute environment within Nextflow Tower.
- Add
- If your cluster does not use modules:
- Source an environment with java and Nextflow using the Advanced Features > Pre-run script field when creating your HPC compute environment in Nextflow Tower.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article