scalaintellij-ideaarmintelrosetta

Problem with running ScalaZ3 on Mac due to conflicting architectures


I am running a Scala project with Z3 on an Apple M2 architecture and I am stuck with the following issue:

If I run the project from IntellIJ, I get the error: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), which makes sense since Z3 relies on x86 dlib files.

However, if I run sbt run the project runs seamlessly, since the terminal recognises sbt as an x86 app and runs it via rosetta.

I have tried to recompile the dlibs from sources on my new machine but they are still x86. I have also tried to run Intellij as x86 with no success.

Is there any way to tell IntellIJ to run my project under rosetta (as an x86?)

Any suggestion would be well appreciated!


Solution

  • The problem was miraculously solved by downloading a x64 JDK and using it to compile the project. The JDK practically forced the machine to run java via rosetta.