今天使用公司電腦運(yùn)行之前的一個(gè)springboot的工程棍厂,結(jié)果啟動(dòng)報(bào)錯(cuò)颗味,報(bào)的錯(cuò)還很奇怪
image
報(bào)錯(cuò)信息:
Build process started. Classpath: /Applications/IntelliJ IDEA 2020.3.app/Contents/plugins/java/lib/jps-launcher.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/lib/tools.jar
SLF4J: 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](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=0x00000001116cf868, pid=23180, tid=0x00000000000038ab
JRE version: Java(TM) SE Runtime Environment (8.0_192-b12) (build 1.8.0_192-b12)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.192-b12 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/***/Library/Caches/JetBrains/IntelliJIdea2020.3/compile-server/hs_err_pid23180.log
Compiled method (c1) 31734 1588 1 java.lang.Integer::intValue (5 bytes)
total in heap [0x0000000111bb74d0,0x0000000111bb7760] = 656
relocation [0x0000000111bb75f8,0x0000000111bb7620] = 40
main code [0x0000000111bb7620,0x0000000111bb76a0] = 128
stub code [0x0000000111bb76a0,0x0000000111bb7730] = 144
scopes data [0x0000000111bb7730,0x0000000111bb7738] = 8
scopes pcs [0x0000000111bb7738,0x0000000111bb7758] = 32
dependencies [0x0000000111bb7758,0x0000000111bb7760] = 8
If you would like to submit a bug report, please visit:
[http://bugreport.java.com/bugreport/crash.jsp](http://bugreport.java.com/bugreport/crash.jsp)
后來在StackOverflow上找到一個(gè)答案感覺比較靠譜,說的是mac新的m1的芯片不支持mac電腦自帶的oracle的jdk1.8牺弹,需要下載zulu的jdk1.8浦马。因?yàn)閙1芯片是arm架構(gòu)。
解決辦法:
安裝zulu版的jdk1.8张漂,然后在idea的project structure里面更改項(xiàng)目使用的SDK版本晶默,選擇zulu jdk1.8。
zulu jdk下載鏈接:https://www.azul.com/downloads/zulu-community/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk
網(wǎng)站下載的zulu版的jdk選擇dmg形式的航攒,然后雙擊安裝就可以了磺陡,mac下默認(rèn)Java虛擬機(jī)的安裝路徑是/Library/Java/JavaVirtualMachines。然后更改項(xiàng)目使用的SDK版本漠畜,F(xiàn)ile -> Project Structure -> Project -> Project SDK币他。點(diǎn)擊NEW,然后點(diǎn)擊+JDK的時(shí)候路徑選擇一直到/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home這一級(jí)就可以了憔狞。
image
image
修改之后啟動(dòng)成功:
image.png