Project won't build on Mac M1

I’m trying to build my project on mac m1. I’m getting the following error :frowning_face:.
Caused by:
java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /private/var/folders/6y/n6b3dsxs6xq2ndpzzysgjrwc0000gp/T/librocksdbjni6414670280292871712.jnilib: dlopen(/private/var/folders/6y/n6b3dsxs6xq2ndpzzysgjrwc0000gp/T/librocksdbjni6414670280292871712.jnilib, 0x0001): tried: ‘/private/var/folders/6y/n6b3dsxs6xq2ndpzzysgjrwc0000gp/T/librocksdbjni6414670280292871712.jnilib’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/6y/n6b3dsxs6xq2ndpzzysgjrwc0000gp/T/librocksdbjni6414670280292871712.jnilib’ (no such file), ‘/private/var/folders/6y/n6b3dsxs6xq2ndpzzysgjrwc0000gp/T/librocksdbjni6414670280292871712.jnilib’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)) [in thread “Test worker”]
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)

Never heard of librocksdbjni.
But googlind suggests something Kafka related.
Do you maybe use some Gradle plugins regarding that which is simply not compatible with your architecture or similar?

I’m not sure :frowning_face: I don’t have any working experience in kotlin/java. I’m exploring our internal project to get started.

What I noticed is I was using java 17.x and I switched to 11.x using jabba use adopt@1.11.0-11. It fixed the problem.
I inspected Dockerfile in the project to know what version we are using, to figure it out.

1 Like