Jmeter keeps crashing on MacOS with openjdk21

633 views Asked by At

I m trying to run jmeter 5.6.2 with openjdk21 and it keeps crashing. https://github.com/Homebrew/homebrew-core/issues/150824 I have gone through this and they have mentioend to update /opt/homebrew/Cellar/jmeter/5.6.2/bin/jmeter but I could not find this. anyone resolved this issue?

I have tried editing the Install_receipt.json and point to the java version 21, but It still crashes

3

There are 3 answers

1
Dmitri T On BEST ANSWER

I cannot reproduce your issue either using Homebrew formula or using normal manual JMeter installation:

enter image description here

You can try out the "manual" way:

  1. Install sdkman

    curl -s "https://get.sdkman.io" | bash 
    

    add sdk command to your PATH

    source "$HOME/.sdkman/bin/sdkman-init.sh"
    
  2. Install Java 21

    sdk install java 21.0.1-ms 
    
  3. Use it in the terminal:

    sdk use java 21.0.1-ms
    
  4. Download JMeter 5.6.2

    wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.6.2.tgz
    
  5. Unpack it

    tar xf apache-jmeter-5.6.2.tgz
    
  6. Launch it

    ./apache-jmeter-5.6.2/bin/jmeter.sh
    

    JMeter GUI should appear, you can add Debug Sampler and View Results Tree listener to double check which Java version is being used.

Be aware that officially JMeter supports Java 17, higher versions can cause problems for example with JSR223 Test Elements.

0
Adarsh Pk On

I had the same error. It started working when I uninstalled jmeter using Homebrew, and installed it manually.

0
mungaih pk On

If anyone else gets the same error, please do as below. It worked for me non JMeter 5.6.3. Navigate to /opt/homebrew/Cellar/jmeter/5.6.2/bin/jmeter Edit the file (user must have elevated privileges) from this:

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

To this:

#!/bin/bash
exec "/opt/homebrew/Cellar/jmeter/${version}/libexec/bin/jmeter"  "$@"

Replace ${version} with your JMeter version (e.g. 5.6.2)