system crashed when run java

My book env:

MacBook Air
Apple M4
15.6.1 (24G90)

I installed JDK

by sdkman and homebrew, but when I ran java, os crashed:
 /opt/homebrew/o/openj/libexec/openjdk.jdk/Contents/Home/bin | stable  ./javac --verison                                                                                   ABRT | 12:32:20
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x000000010211b340, pid=7237, tid=9987
#
# JRE version:  (21.0.7) (build )
# Java VM: OpenJDK 64-Bit Server VM (21.0.7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.dylib+0x35f340]  CodeHeap::allocate(unsigned long)+0x15c
#
# No core dump will be written. 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:
# /opt/homebrew/Cellar/openjdk@21/21.0.7/libexec/openjdk.jdk/Contents/Home/bin/hs_err_pid7237.log
#
#
[1]    7237 abort      ./javac --verison

Does that mean I have to reinstall OSX?

Answered by DTS Engineer in 856264022

Expanding a little on Etresoft’s comments…

The log you showed indicates that Java is having trouble allocating memory. The Apple Developer Forums are primarily focused on Apple APIs and tools, so we’re not really in a position to help you with problems that occur within your Java runtime. For help with that I recommend that you escalate this via the support resources for the runtime vendor. In this case you have two vendors:

  • The OpenJDK folks
  • Homebrew

You can help isolate the issue by installing OpenJDK outside of Homebrew. If that works and installing it with Homebrew fails, you should talk to the Homebrew folks. OTOH, if OpenJDK fails ‘out of the box’, you should talk to the OpenJDK folks.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

That's not an OS crash. It's just Java. Get rid of Homebrew and download Java directly.

Expanding a little on Etresoft’s comments…

The log you showed indicates that Java is having trouble allocating memory. The Apple Developer Forums are primarily focused on Apple APIs and tools, so we’re not really in a position to help you with problems that occur within your Java runtime. For help with that I recommend that you escalate this via the support resources for the runtime vendor. In this case you have two vendors:

  • The OpenJDK folks
  • Homebrew

You can help isolate the issue by installing OpenJDK outside of Homebrew. If that works and installing it with Homebrew fails, you should talk to the Homebrew folks. OTOH, if OpenJDK fails ‘out of the box’, you should talk to the OpenJDK folks.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

system crashed when run java
 
 
Q