Search code examples
macosjmeterjava-21

Jmeter keeps crashing on MacOS with openjdk21


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


Solution

  • 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.