m1 mac jdk 报错

最近买了个 m1 芯片的 mac mini ,我把 MacBook Pro 的数据迁移到了 M1 Mac mini 上,发现在 Mac mini 上运行 java 程序的时候报错。

报错:Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

Build process started. Classpath: /Applications/IntelliJ IDEA.app/Contents/plugins/java/lib/jps-launcher.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/tools.jarSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGFPE (0x8) at pc=0x00000001116d3868, pid=2163, tid=0x000000000000670f
#
# JRE version: Java(TM) SE Runtime Environment (8.0_201-b09) (build 1.8.0_201-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# j  com.sun.tools.javac.comp.ConstFold.fold2(ILcom/sun/tools/javac/code/Type;Lcom/sun/tools/javac/code/Type;)Lcom/sun/tools/javac/code/Type;+877
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/gaohanghang/Library/Caches/JetBrains/IntelliJIdea2020.3/compile-server/hs_err_pid2163.log
Compiled method (c1)   26686 1826       1       java.lang.Integer::intValue (5 bytes)
 total in heap  [0x0000000111c872d0,0x0000000111c87560] = 656
 relocation     [0x0000000111c873f8,0x0000000111c87420] = 40
 main code      [0x0000000111c87420,0x0000000111c874a0] = 128
 stub code      [0x0000000111c874a0,0x0000000111c87530] = 144
 scopes data    [0x0000000111c87530,0x0000000111c87538] = 8
 scopes pcs     [0x0000000111c87538,0x0000000111c87558] = 32
 dependencies   [0x0000000111c87558,0x0000000111c87560] = 8
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

1. 解决方式

原因是因为 M1 Mac mini 的 M1 芯片使用的是 ARM 架构,需要下载ARM版的JDK。

1.1 安装 ARM 版本 JDK

下载链接:

https://www.azul.com/downloads/zulu-community/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk

1.2 idea 选择刚安装的 arm 版本 jdk

在这里插入图片描述

完美运行

在这里插入图片描述

2. 参考

https://stackoverflow.com/questions/64788005/java-jdk-for-apple-m1-chip

https://www.ithome.com/0/520/136.htm

https://code2care.org/q/install-native-java-jdk-jre-on-apple-silicon-m1-mac

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值