Couchbase-lite-java in arm64 architecture

hi everyone, I created a small project in java using the couchbaselite 3.1.1 library…I wanted to compile it for an arm64 architecture and I get this error how can I use this library in arm64
thanks in advance for the help

OpenJDK Client VM warning: You have loaded library /home/level/TestCouchBaseLite/CouchbaseLiteTemp/d3641d7d6861cb9e1ca084b36a0e924f/ which might have disabled stack guard. The VM will try to fix the stack guard now.
It’s highly recommended that you fix the library with ‘execstack -c ’, or link it with ‘-z noexecstack’.
Exception in thread “main” java.lang.IllegalStateException: Cannot load native library @/home/level/TestCouchBaseLite/CouchbaseLiteTemp/d3641d7d6861cb9e1ca084b36a0e924f/ for Linux/arm
at com.couchbase.lite.internal.NativeLibrary.load(
at com.couchbase.lite.internal.CouchbaseLiteInternal.init(
at com.couchbase.lite.CouchbaseLite.init(
at com.couchbase.lite.CouchbaseLite.init(
at com.couchbase.lite.CouchbaseLite.init(
at igesa.MaincouchBaseLite.main(
Caused by: java.lang.UnsatisfiedLinkError: /home/level/TestCouchBaseLite/CouchbaseLiteTemp/d3641d7d6861cb9e1ca084b36a0e924f/ /home/level/TestCouchBaseLite/CouchbaseLiteTemp/d3641d7d6861cb9e1ca084b36a0e924f/ wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.load0(
at java.lang.System.load(
at com.couchbase.lite.internal.NativeLibrary.load(
… 5 more

If this is just using the stock library from maven then there is no arm64 support available unfortunately.

It sort of looks like you compiled your own core (beware the license!) though in which case it also looks like the device you are running on is arm not arm64 judging by the error messages.

thanks so much for the reply, do you know if there is another way I could interact with my java application? Or if there is a way to do it, does it work? another library or a compilation of the library in c

Linux/ARM is just not something we support, at the moment: We reallly don’t have experience with it. It seems theoretically possible that you could build LiteCore (as @borrrden says, note the license!) and then bundle it into the Java build. Of course, you’ll have to build the Java JNI code too. It seems like a fairly daunting task.

just for information, is there a package to generate the JNI? Which package should I use?

The JNI is not a separate package: it is part of the Android build.

The code is in /common/common/main/cpp. Gradle uses the AGP and NDK (see /ce/android/lib/build.gradle) to run CMake. The CMakeLists build script is /common/common/main/CMakeLists.txt

There is a guide document to test it?

Not that i know of, as such.

The code in build.gradle is, if not trivial, more or less straightforward. Same with the code in CMakeLists.

The build succeeds on my machine and our build machines (Java, WIndows, Linux), so it can at least, work. If it doesn’t work, you should get a decipherable error message. If that doesn’t get you to success, try posting the issue here.