Can't run on M1 Mac - java.lang.UnsatisfiedLinkError

I can’t use the SDK on an M1 Mac using IntellJ CE 2021.3.

My build.gradle entry:
implementation “com.couchbase.lite:couchbase-lite-java:3.0.0-beta02” (also tried it with 2.8.4).

Anytime I try to create a database I get this error:
Caused by: java.lang.UnsatisfiedLinkError: /Users/ale/Projects/server/CouchbaseLiteTemp/c593025b447bb8502ea01ad9cf36f055/libLiteCore.dylib: dlopen(/Users/ale/Projects/server/CouchbaseLiteTemp/c593025b447bb8502ea01ad9cf36f055/libLiteCore.dylib, 0x0001): tried: ‘/Users/ale/Projects/server/CouchbaseLiteTemp/c593025b447bb8502ea01ad9cf36f055/libLiteCore.dylib’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64e’)), ‘/usr/lib/libLiteCore.dylib’ (no such file)

I’m using the Azul Java11 JDK, but I’ve also tried different versions of the OpenJDK (11, 16, 17).
Please help.

Thank you in advance.

At this time, Couchbase Lite Java is not supported on the M1. The list of supported platforms is available here. Support for M1 will be considered in our roadmap.

As an aside, iOS and macOS versions of Couchbase Lite 3.0 (Beta) is supported on M1.

Note that if my understanding is correct, this will happen if you download the ARM version of the JDK, but if you download the x86_64 version of the JDK Rosetta will kick in and Java will load the x86_64 native library.

It works! I’ve downloaded a x86_64 version of the JDK and the error is finally gone. 'Let me thank the Rosetta gods.
Thx for the hint @borrrden <3