Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple M1 - Maven Java dependency that is not yet available for macosx-arm64

I am trying to get a Java/Maven project working on an Apple M1 with a dependency that is not yet available for the M1 chip. In my case this is nd4j but it could be any other dependency.

<dependency>
   <groupId>org.nd4j</groupId>
   <artifactId>nd4j-native</artifactId>
   <version>1.0.0-beta7</version>
</dependency>

I am using IntelliJ for this project.

I am looking for a way to specify some sort of "compatibility mode" that tells maven/IntelliJ to fetch dependencies for X86 chips and execute Java, the tests, maven, etc. with Rosetta. If that's not possible, what could be other was to solve this?

like image 451
Robin Avatar asked Mar 22 '21 10:03

Robin


1 Answers

You can install both x86_64 based and arm64 based JDKs on your machine, and switch between these as needed. A tool like SDKMAN! can help you with that: How to install x86 and Arm JDKs on the Mac M1

If your maven and IntelliJ use the default JDK, they will automatically switch between x86_64 and Arm64 architecture, when you switch JDKs.

like image 68
Mario Varchmin Avatar answered Sep 22 '22 16:09

Mario Varchmin