mac installation jmeter

macOS 10.12

JMeter following installation steps:

  • Install the JDK
  • Installation JMeter

1. Select Version

JDK 8  https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

JMeter 5.2

 

2. Install the JDK

 

 Select the download version

 

 After downloading open the file, enter the installation page

 

 

After installation is complete, open the terminal (Terminal), java -version input may be used to check that the machine is installed JDK:

 

Terminal input  / usr / libexec / java_home -V view the directory path of the installation

 

 

3. Configure the java environment variables 

 

 After the JDK installation is successful, you need to configure the environment variables, environment variables need to be configured in Windows is "JAVA_HOME", "path", "classpath", under the Mac is similar.

 

Open the terminal input vim .bash_profile, will enter the vim editor, as shown below:

 

 Configure the environment variables .bash_profile file, enter the following code (# are comments later, for viewing only, no input).

export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home# 等号右边的路径目录,可以通过/usr/libexec/java_home -V这个命令得到 
export JAVA_HOME
=$JAVA_8_HOME # 设置一个中间变量,为了方便多个JDK版本时更换JAVA_HOME
export PATH
=$JAVA_HOME/bin:$PATH:. #冒号前代表JDK目录下的bin目录,冒号后代表当前目录

 

vim编辑器的使用(删除/退出/复制等等 https://www.runoob.com/linux/linux-vim.html

insert 模式/ esc退出输入模式  (输入 i 是进入编辑模式)

冒号(切换到底线命令模式Last line mode)、w(保存文件)、q(退出文件)、回车(执行命令),即可退出vim编辑器,并保存.bash_profile文件。

 

 

 

 回到终端

 

在终端中输入source ~/.bash_profile,作用是让这个配置文件在修改后立即生效,最后,输入echo $JAVA_HOME,当输出的JAVA_PATH正确时,证明环境变量已经配置成功了。

 

 

 4.安装jmeter

下载地址 http://jmeter.apache.org/download_jmeter.cgi

  • Binaries:二进制版,即已经编译好、可直接执行;  
  • Source:源代码版,需要自己编译;

 

 

下载  apache-jmeter-5.2.1.tgz 这个Binaries版本,下载完成后,解压,可以通过Finder页面双击这个文件解压,也可以通过终端输入 tar zxvf apache-jmeter-5.0.tgz解压
 
5.启动jmeter
解压后的文件有

 

 进入bin,启动jmeter

(注:如果是终端模式。进入到bin目录下,通过sh jmeter命令来启动JMeter)

 

6.优化

现在,我们已经可以成功启动JMeter了,但是每次都需要打开终端、进入到JMeter的bin目录下,输入sh jmeter命令来启动,显得有点繁琐。

可以直接把JMeter配置到环境变量中。

mac终端输入jmeter直接启动(无需路径)

 

 

Guess you like

Origin www.cnblogs.com/may18/p/12298991.html