Mac M1芯片Java开发环境搭建 · 排错处理

写文章就是为了帮助更多的人!顺便留下自己的成长轨迹。。。

如果对你有用 记得收藏+点赞+关注额 !!!

---- Nick.Peng


一、编译镜像报错

报错信息

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project app: Unable to resolve artifact: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:osx-aarch_64:3.9.1
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.9.1 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.9.1 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) funenc.flowable_java:app:jar:0.0.1-SNAPSHOT
[ERROR] 2) com.google.protobuf:protoc:exe:osx-aarch_64:3.9.1
在这里插入图片描述

解决方案

  • 原因时目前M1 对protobuf不支持,这里直接修改maven的settings.xml 来解决;
  • 打开~/.m2/settings.xml配置文件,添加以下内容即可,如图所示:
    <profile>
     <id>apple-silicon</id>
      <properties>
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
      </properties>
    </profile>
    
    <activeProfiles>
      <activeProfile>
        apple-silicon
      </activeProfile>
    </activeProfiles>
    
    在这里插入图片描述
  • 重新编译,问题解决

二、同步仓库报错

报错信息

java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process “jps.track.ap.dependencies” VM flag to enable/disable incremental annotation processing environment.

解决方案

  • 打开idea设置,在以下位置增加这个配置:-Djps.track.ap.dependencies=false
    在这里插入图片描述
  • 清除缓存在这里插入图片描述
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值