Support Apple Silicon chips - Exception: No native library is found for and os.arch=aarch64 - sqlite.jdbc


I am using the DIAMOND+MEGAN pipeline and having troubles “meganizing” the .daa file with the AnnoTree mapping database.

I am using macOS Monterey 12.6 with a Apple M1 Pro chip with 32 GB.

For me it seems that the current build of MEGAN does not support Apple Silicon chips, because I get an Exception when running daa-meganizer that is related to the bundled sqlite.jdbc@3.30.1 library when opening the SQL database.
The exception occurs when running via commandline and also via the graphical user interface.

The error is related that MEGAN uses an old version of sqlite.jdbc (3.30.1) that does not support Apple Silicon chips (aarch64) yet.
I have found the Github issue “No native library found for darwin aarch64” on xerial / sqlite-jdbc that is related to this problem.

Command I used to run and the error message:

(base) bernhard@macbook megan-annoTree-db % /Applications/MEGAN-CE/tools/daa-meganizer -i sample_diamond_meganized.daa -mdb megan-mapping-annotree-June-2021.db --threads 10 --verbose
Meganizer - Prepares ('meganizes') a DIAMOND .daa file for use with MEGAN
	--in: sample_diamond_meganized.daa
	--longReads: false
	--classify: true
	--minScore: 50.0
	--maxExpected: 0.01
	--minPercentIdentity: 0.0
	--topPercent: 10.0
	--minSupportPercent: 0.01
	--minSupport: 0
	--minPercentReadCover: 0.0
	--minPercentReferenceCover: 0.0
	--minReadLength: 0
	--lcaAlgorithm: naive
	--lcaCoveragePercent: 100.0
	--readAssignmentMode: readCount
Classification support:
	--mapDB: megan-mapping-annotree-June-2021.db
Deprecated classification support:
	--parseTaxonNames: true
	--firstWordIsAccession: true
	--accessionTags: gb| ref|
	--threads: 10
	--tempStoreInMemory: false
	--propertiesFile: /Users/bernhard/Library/Preferences/MEGAN.def
	--verbose: true
Version   MEGAN Community Edition (version 6.24.2, built 24 Oct 2022)
Author(s) Daniel H. Huson
Copyright (C) 2022 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Java version:
Loading 2,396,736
Loading ncbi.tre: 2,396,740
Caught: java.sql.SQLException: Error opening connection
	at megan/megan.classification.IdMapper.loadMappingFile(
	at megan/
	at megan/
Caused by: java.sql.SQLException: Error opening connection
	at sqlite.jdbc@3.30.1/
	at sqlite.jdbc@3.30.1/org.sqlite.SQLiteConnection.<init>(
	at sqlite.jdbc@3.30.1/org.sqlite.jdbc3.JDBC3Connection.<init>(
	at sqlite.jdbc@3.30.1/org.sqlite.jdbc4.JDBC4Connection.<init>(
	at sqlite.jdbc@3.30.1/org.sqlite.JDBC.createConnection(
	at sqlite.jdbc@3.30.1/org.sqlite.SQLiteConfig.createConnection(
	at megan/megan.accessiondb.AccessAccessionMappingDatabase.<init>(
	at megan/megan.accessiondb.AccessAccessionAdapter.<init>(
	at megan/megan.classification.IdMapper.loadMappingFile(
	... 2 more
Caused by: java.lang.Exception: No native library is found for and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
	at sqlite.jdbc@3.30.1/org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(
	at sqlite.jdbc@3.30.1/org.sqlite.SQLiteJDBCLoader.initialize(
	at sqlite.jdbc@3.30.1/org.sqlite.core.NativeDB.load(
	at sqlite.jdbc@3.30.1/
	... 10 more
(base) bernhard@macbook megan-annoTree-db % 

I would appreciate if you could release a new MEGAN version which supports Apple Silicon chips with regard to connecting to the mapping database.
I think it should be sufficient if you bundle MEGAN with a newer version of sqlite-jdbc built after June 27, 2021 (at least release 3.36.0), since the library supports Apple Silicon chips as of that date.

Thank you so much for your support and this great tool! :blush:

All the best,

Dear Bernhard, thank you for pointing out the problem, it has been fixed, please update to release 6.24.4.

@Daniel thank you for the fast fix and the new MEGAN release.
I have updated to the latest release and it works now also on Apple Silicon chips. :blush:

Best regards,