JMeter 2.10 uses a new method for recording HTTPS requests when running under Java 7.

There have been some reports of problems starting the recorder, with errors such as the following:

ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Cannot run program "keytool" (in directory "C:\apache-jmeter-2.10\bin"): CreateProcess error=2, The system cannot find the file specified

This means that the "keytool" application could not be found on the PATH. Please ensure that the PATH includes the bin directory for the appropriate Java installation.

If this was not correctly set when Java was installed, it may be necessary to update the script that starts JMeter.

For example add the following to jmeter.bat (Windows)

set JAVA_HOME=<path to JDK>
rem for example
set JAVA_HOME=C:\jdk1.7.0_45

set PATH=%JAVA_HOME%\bin;%PATH%

Similarly for Unix, update the script "jmeter" or "jmeter.sh":

JAVA_HOME=<PATH TO JDK>  # for example JAVA_HOME=/usr/java170

export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH

This should fix the problem. However note that the path will almost certainly have to be changed if a new version of Java is installed, so ideally the system PATH should be set to include the correct location for Java.


Another cause of errors is where the JMeter bin directory is not writable, as JMeter defaults to creating the keystore in the bin directory. For example

Could not create script recording proxy - see log for details: Command :'"C:\Program Files\Java\jre7\bin\keytool" -genkeypair -alias :root_ca: -dname "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: user, C=US" -keyalg RSA -keystore proxyserver.jks -storepass {redacted) -keypass {redacted) -validity 7 -ext bc:c' failed, code: 1
keytool error: java.io.FileNotFoundException: proxyserver.jks (Access is denied)

The last line shows the cause.

The cure is to tell JMeter where to create the keystore, by defining the property

proxy.cert.directory

See: http://jmeter.apache.org/usermanual/component_reference.html#HTTP%28S%29_Test_Script_Recorder

  • No labels