Search code examples
javajmeterkeytoolrecorderkey-pair

JMeter unrecognized command -genkeypair


If I try to start recording with JMeter I get the error unrecognized command -genkeypair.

This error is shown because there exists 2 versions of the tool keytool.

JMeter is using the wrong, system keytool and this doesn't know the option '-genkeypair'.

How to force Apache JMeter to use the keytool of java JDK/JRE?


Solution

  • First try was to set the JAVA Path in $PATH with PATH=$PATH:$JAVA_HOME/bin but this was not the solution, because JMeter nevertheless uses the first found/discovered keytool-path in $PATH.

    And this was the solution: I set the path to the java keytool not at the end of $PATH but on the beginning.

    PATH=$JAVA_HOME/bin:$PATH

    Hope it helps you too.