jmeter: JMeter cannot be run in macOS Sonoma (Apple Silicon) by Homebrew

Expected behavior

Run jmeter successfully

Actual behavior

JMeter crashed after display startup logo

Screenshot 2023-10-06 at 15 29 48

Below are defailed report. crash_report.log

Steps to reproduce the problem

  1. Install jmeter by homebrew (automatically install openJDK)
brew install jmeter
  1. run jmeter in terminal/iTerm2
jmeter
  1. I re-tested it by Amazon-Corretto-11 & 21, it is the same result.

It looks like no useful info in jmeter.log jmeter.log

JMeter Version

5.6.2

Java Version

11.0.20.1

OS Version

macOS Sonoma Version 14.0 (23A344)

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Reactions: 15
  • Comments: 29 (1 by maintainers)

Most upvoted comments

uname -r # => 23.1.0
uname -m # => arm64
brew install corretto

# => successful launch on an M1
JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home/ exec /opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter

Could you please try downloading and running 5.6.2 from https://jmeter.apache.org/download_jmeter.cgi to rule out homebrew packaging issue?

Yes, you are right. The binary from Apache Website is working. I think it is related OpenJDK bundled with Homebrew. I see it always imports JAVA_HOME by OpenJDK-17 provided by brew in /opt/homebrew/Cellar/jmeter/5.6.2/bin/jmeter

#!/bin/bash
JAVA_HOME="/opt/homebrew/opt/openjdk@17" exec "/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter"  "$@"

After edited as below (Then it will use my configured JDK instead of provided by Homebrew), it works.

#!/bin/bash
exec "/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter"  "$@"
uname -r # => 23.1.0
uname -m # => arm64
brew install corretto

# => successful launch on an M1
JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home/ exec /opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter

This worked for me when I run it command line instead of in the .zshrc file

I’ll try to make a small tutorial on this. LMK if you can’t still get it working.

Could you please try downloading and running 5.6.2 from https://jmeter.apache.org/download_jmeter.cgi to rule out homebrew packaging issue?

@RukshanJS

Thanks. Everything is working fine now.

I found this issue when setting up a new M3 machine.

I also use a M1 machine that I’ve used with Jmeter 5.4.3 for a long time and I recently updated it from Ventura to Sonoma and Jmeter continued working normally without the need to install corretto. So maybe downgrading to an older version can be another possible workaround.

Well done. Thanks a lot @RukshanJS

Now, It’s working

I’ll try to make a small tutorial on this. LMK if you can’t still get it working.

I can’t wait for it.

Thanks

uname -r # => 23.1.0
uname -m # => arm64
brew install corretto

# => successful launch on an M1
JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home/ exec /opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter

will it work if I use sdkman to manage Java versions?

the same fix as @zzxrain doesn’t work for me, m1 with Sonoma

  • installed jmeter using homebrew
  • installed the openjdk@21 with homebrew
  • changed the jmeter file in this way #!/bin/bash JAVA_HOME="/opt/homebrew/opt/openjdk@21" exec "/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter" "$@"

if I remove the JAVA_HOME from the file I still have the same issue

if I try to download from https://jmeter.apache.org/download_jmeter.cgi I have the same issue

Any help?

@weisJ , do you think it might be Darklaf-related?

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x000000018749161c

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [6785]

Application Specific Information:
References to Carbon menus are disallowed with AppKit menu system (see rdar://101002625). Use instances of NSMenu and NSMenuItem directly instead.

@zzxrain , do you think you could try running without darklaf? For instance: Download sources, replace LAF as follows:

--- a/src/core/src/main/java/org/apache/jmeter/gui/action/LookAndFeelCommand.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/action/LookAndFeelCommand.java
@@ -172,7 +172,7 @@ public class LookAndFeelCommand extends AbstractAction {
      * @return command that would activate the preferred LaF
      */
     public static String getPreferredLafCommand() {
-        String laf = PREFS.get(USER_PREFS_KEY, null);
+        String laf = "laf:com.apple.laf.AquaLookAndFeel";
         if (laf != null) {
             return laf;
         }

Start JMeter with ./gradlew runGui

Will it launch?