Skip to content

Installation running errors

Sina Majidian edited this page Jun 19, 2024 · 8 revisions

1) JAVA for nextflow

If you face this when running nextflow, you need to have proper a java installed.

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: nextflow/cli/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)

which is related to java version

$ java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-b07)
OpenJDK 64-Bit Server VM (build 25.372-b07, mixed mode)

Nextflow (and FastOMA) needs version 11.

You can install openjdk using conda (openjdk is the free version of java).

conda install conda-forge::openjdk

then you will have

$ java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment JBR-11.0.13.7-1751.21-jcef (build 11.0.13+7-b1751.21)
OpenJDK 64-Bit Server VM JBR-11.0.13.7-1751.21-jcef (build 11.0.13+7-b1751.21, mixed mode)

If it still shows you the other java previously had been installed on your system, you probably need to add the path

JAVA_HOME="/path/to/jdk-17"
NXF_JAVA_HOME="/path/to/jdk-17"
export PATH="/path/to/jdk-17/bin:$PATH"

or

JAVA_CMD="$(which java)"

2) XML

Traceback (most recent call last):
  File " software/miniconda/envs/f4/bin/fastoma-collect-subhogs", line 8, in <module>
    sys.exit(fastoma_collect_subhogs())
  File " software/miniconda/envs/f4/lib/python3.8/site-packages/FastOMA/collect_subhogs.py", line 140, in fastoma_collect_subhogs
    write_hog_orthoxml(conf_collect_subhogs.pickle_folder, conf_collect_subhogs.out, conf_collect_subhogs.gene_id_pickle_file,
  File " software/miniconda/envs/f4/lib/python3.8/site-packages/FastOMA/collect_subhogs.py", line 194, in write_hog_orthoxml
    ET.indent(orthoxml_file, space='  ', level=0)
AttributeError: module 'xml.etree.ElementTree' has no attribute 'indent'

Probably you are using python 3.8. Try python 3.9!

3) Numpy issue

Traceback (most recent call last):
  File "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/software/miniconda/envs/f39p/bin/omamer", line 8, in <module>
    sys.exit(main())
  File "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/software/miniconda/envs/f39p/lib/python3.9/site-packages/omamer/main.py", line 33, in main
    from tables import PerformanceWarning
  File "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/software/miniconda/envs/f39p/lib/python3.9/site-packages/tables/__init__.py", line 44, in <module>
    from .utilsextension import get_hdf5_version as _get_hdf5_version
  File "tables/utilsextension.pyx", line 1, in init tables.utilsextension
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Install numpy version 1.23 using pip install numpy==1.23

To make sure it is solved you can run omamer -h

Overal

You could install like this

conda create -n fasto python=3.10
conda activate fasto
git clone https://github.com/DessimozLab/FastOMA.git
conda install bioconda::fasttree
conda install bioconda::mafft
conda install conda-forge::openjdk

pip install .[report,nextflow] 
pip install numpy==1.23