Apple silicon(M1) 11.4 get a java error (jdk16)
Asked Answered
D

7

12

A fatal error has been detected by the Java Runtime Environment:

Internal Error (sharedRuntime.cpp:531), pid=2424, tid=7427

Error: ShouldNotReachHere()

JRE version: OpenJDK Runtime Environment (16.0+14) (build 16+14)

Java VM: OpenJDK 64-Bit Server VM (16+14, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)

No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit: https://bugreport.java.com/bugreport/crash.jsp

--------------- T H R E A D --------------- Current thread (0x000000015400be00): JavaThread "main" [_thread_in_Java, id=7427, stack(0x000000016d7b0000,0x000000016d9b3000)] Stack: [0x000000016d7b0000,0x000000016d9b3000], sp=0x000000016d9b1750, free space=2053k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.dylib+0x9b4130] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x46c V [libjvm.dylib+0x9b4884] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40 V [libjvm.dylib+0x2ad690] report_vm_error(char const*, int, char const*, char const*, ...)+0x5c V [libjvm.dylib+0x2ad864] report_should_not_reach_here(char const*, int)+0x2c V [libjvm.dylib+0x818d4c] SharedRuntime::raw_exception_handler_for_return_address(JavaThread*, unsigned char*)+0x178 V [libjvm.dylib+0x818df0] SharedRuntime::exception_handler_for_return_address(JavaThread*, unsigned char*)+0x28 v ~StubRoutines::forward exception j java.lang.Class.forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;+43 java.base@16 ...

Error happens even I reinstall MacOS:

  1. JDK16 installed via brew
  2. JDK16 installed via Zulu
  3. JDK17 installed via Zulu

But it works well:

  1. JDK15 installed via Zulu

Someone says that everything is fine with JDK16(Zulu), and I don't know why.

Dealt answered 25/5, 2021 at 8:32 Comment(0)
M
8

If you have installed via brew then by running brew upgrade fixed my issue.

Mcguinness answered 23/6, 2021 at 5:24 Comment(1)
This saved me a lot of headache. Thanks!Alodium
J
6

Using the java11 / openjdk@11 brew formula got me going for now.

Did a bit more digging and saw this referenced over at the openjdk issue tracker: https://bugs.openjdk.java.net/browse/JDK-8267235

There is currently a github issue over at https://github.com/Homebrew/homebrew-core/issues/77954 reporting the issue for what is installed by the brew formula itself. It looks like there may be some pull requests already so expect it to be resolved soon.

Jehol answered 25/5, 2021 at 20:18 Comment(2)
Thank you!I will keep track of it.Dealt
Nice work @ben-mayes — openjdk@11 works just fine for now.Beverlybevers
O
6

Updating to Zulu: 16.30.19 - https://cdn.azul.com/zulu/bin/zulu16.30.19-ca-jdk16.0.1-macosx_aarch64.dmg fixed myissue

Oceanus answered 30/5, 2021 at 16:3 Comment(1)
thanks! the only thing that did the trick!Heterogamete
A
4

The mvn formula in brew seems to prefer always using openjdk formula even with openjdk@11 installed. I ended up setting JAVA_HOME, which mvn will use, to solve this problem along with installing Zulu 11 at /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home .

# Ensure JAVA_HOME is set for mvn since JAVA_HOME will take precedence over homebrew dependency
export JAVA_HOME=$(/usr/libexec/java_home)
Anywheres answered 4/6, 2021 at 18:44 Comment(0)
Y
1

I agree with Ben Mayes, use Java 11. I would like to provide a detailed description of how to do this, for beginners like me.

Step 1: Go to this page to download Java 11. Near the bottom of the page, you will select which version of Java to download. For operating system, choose macOS. For architecture, choose ARM 64-bit. For Java package, choose JDK. Then, choose the .dmg option below to download. Double click on the .dmg file to install it.

Step 2: Follow this tutorial. The only thing I really had to change was using the .zshrc profile instead of the .bash profile. This will be the name of the version you will use: zulu-11.jdk.

This will be the text you put in the .zshrc file you have:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

Step 3: If you are using intelliJ or another IDE, you might need to change the version that the project is using. Follow this tutorial on how to do that.

Yahairayahata answered 19/6, 2021 at 15:20 Comment(1)
You are God. Thanks mate!!!Sassafras
P
1

Had this issue in my Mac m1 machine.. just ran this command brew upgrade and my issue got resolved

Perlite answered 29/6, 2021 at 12:32 Comment(0)
E
0

Tried all the answers but the arm version of the sdk didnt seem to work, ironically the x86 version of the sdk did the job for me. https://www.azul.com/downloads/?os=macos&architecture=x86-64-bit&package=jdk

Emplane answered 21/3, 2022 at 6:20 Comment(1)
This should have been solved within a few days of my question...You can download any arm version as normalDealt

© 2022 - 2024 — McMap. All rights reserved.