M1的macMini使用IDEA无法启动Nacos,如何解决?(语言-java|操作系统-macos)

问题产生环境:
  • 电脑:macMini-M1
  • 操作系统:macOS arm64
  • jdk:zulu的arm64-jdk8
  • IDE:IDEA-arm64(最新版)
产生的问题:
  • 基于上述环境,配置好数据库后启动Nacos失败
启动后报错信息如下:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'instanceOperatorClientImpl' 
defined in URL [jar:file:/Users/nan/DevelopmentEnvironment/apache-maven-3.8.3/repository/com/pig4cloud/nacos/nacos-naming/2.0.2/nacos-naming-2.0.2.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]:

Unsatisfied dependency expressed through constructor parameter 1; 
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'clientOperationServiceProxy' 
defined in URL [jar:file:/Users/nan/DevelopmentEnvironment/apache-maven-3.8.3/repository/com/pig4cloud/nacos/nacos-naming/2.0.2/nacos-naming-2.0.2.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]:

Unsatisfied dependency expressed through constructor parameter 1; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'persistentClientOperationServiceImpl' 
defined in URL [jar:file:/Users/nan/DevelopmentEnvironment/apache-maven-3.8.3/repository/com/pig4cloud/nacos/nacos-naming/2.0.2/nacos-naming-2.0.2.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: 

Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]:

Constructor threw exception; 
nested exception is java.lang.UnsatisfiedLinkError: 
/private/var/folders/v3/6rrwvvbd49d5ls4k1cn14sw40000gn/T/librocksdbjni7048705000285793229.jnilib:
dlopen(
/private/var/folders/v3/6rrwvvbd49d5ls4k1cn14sw40000gn/T/librocksdbjni7048705000285793229.jnilib, 0x0001):
tried: 
'/private/var/folders/v3/6rrwvvbd49d5ls4k1cn14sw40000gn/T/librocksdbjni7048705000285793229.jnilib' 
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')),
'/usr/lib/librocksdbjni7048705000285793229.jnilib' (no such file)
通过报错初步分析如下:
  • 因为bean类加载失败导致了一系列的问题(类找不到、实例加载失败、容器加载失败)
  • */librocksdbjni7048705000285793229.jnilib出现了一些问题
    • 看样子是rocksdb的问题导致的
      • rocksdb在本地临时性文件出现了问题,这个文件是'x86_64'的,但是系统只识别'arm64e'
      • '/usr/lib/'路径没有操作权限
通过度娘等途径并未查找到相似的问题以及解决方案
各位🐮人及看官劳烦帮忙分析下这个问题,顺便提供下解决方案

同问题,楼主解决了吗

jdk版本问题吧,我的11报这个,改为8就好了

是要装xcode的,mac上很多开发人员工具都是依赖于xcode的基准库来运行的,如果电脑上没有安装xcode会报类似错误,但不确定安装xcode可以完全解决,建议还是先安装上xcode试一下~