Install Jmeter and its configuration on Mac

1. Install the JDK environment

Installation method: Configure the JDK environment under mac

If the JDK environment has been installed, you can ignore this step. To check the method, enter java -version in the terminal. If the java version appears, it means that the JDK environment has been configured, as shown in the following figure:

2. Install Jmeter

Download URL: Apache JMeter - Download Apache JMeter

Enter the download address page of JMeter, as shown in the figure below, there are two versions available for download:

  • Binaries: Binary version, which has been compiled and can be executed directly;
  • Source: source code version, you need to compile it yourself;

We download the Binaries version of apache-jmeter-5.0.tgz . After the download is completed, decompress it. You can double-click the file to decompress it through the Finder page, or you can tar zxvf apache-jmeter-5.0.tgzdecompress it through the terminal input.

3. Start Jmeter

After the decompression is complete, enter the jmeter directory and get the following directory files:

Enter the bin directory and sh jmeterstart JMeter through the command, as shown below. Don't use GUI mode for load testing: This is a prompt message. Do not use GUI mode for load testing. Use NON GUI mode, and then you will see Jmeter. startup animation.

4. Configure Jmeter environment variables

Now, we can successfully start JMeter, but every time we need to open the terminal, enter the bin directory of JMeter, and enter the sh jmetercommand to start, it seems a bit cumbersome.

When we are familiar with the ~/.bash_profile (~/.zshrc) file, we can directly configure JMeter into the environment variable.

Enter the environment variable editing page through open ~/.bash_profile(zsh终端的就是~/.zshrc , and enter the following command:)

#jmeter配置
export JMETER_HOME=/Users/wangjie/apache-jmeter-5.6.2 #这个路径记得换成你自己的Jmeter解压路径
export PATH=$JMETER_HOME/bin:$PATH

Exit the editor after saving, and enter source ~/.bash_profile(zsh终端的就是~/.zshrc in the terminal ). Next comes the key point, enter directly in the terminal (any directory) jmeterto start JMeter.

5. Change JMeter language to Chinese

After starting the GUI mode of JMeter, the default language is English, and it also comes with several languages. We can switch JMeter to Chinese from the menu bar, as shown in the figure below. Chinese (Simplified) means Chinese (Simplified), and Chinese (Traditional) means Chinese (Traditional).

After the setting is complete, close JMeter, restart the GUI mode, and you will find that the language has changed to English again. This is because the default is English, so to change the default language to Chinese, modify the configuration file.

file path:

/Users/XXX/apache-jmeter-5.5/bin/jmeter.properties this file. In the jmeter.properties file in the bin directory of the Jmeter folder after you download and decompress.

Open this file with Sublime Text or vim command and find this area:

#Preferred GUI language. Comment out to use the JVM default locale's language.

#language=en

change into:

#Preferred GUI language. Comment out to use the JVM default locale's language.

language=zh_CN  #记得去掉language=zh_CN前面的“#”,否则不生效

After opening JMeter again, you will find that the default language is changed to Chinese. PS: Note that the # in front of the language must be removed, otherwise it will have no effect.

Guess you like

Origin blog.csdn.net/weixin_65784341/article/details/132582783