Prepare:
1.jmeter4.0 source code - apache-jmeter-4.0_src.zip
2.IDE Eclipse - Oxygen.3 Release (4.7.3)
3.JDK - 1.8.0_122
Start:
1. Create a new java project
2. Import jmeter4.0 source code
Project structure after importing the source code:
3. Ant downloads and compiles the dependent jar, the downloaded jar package will be in the %eclipse_workspace%\jmeter_leocnx\MyJmeter\lib directory
First remove install, select download_jars
Click run to start downloading dependencies
4. Configure classpath
Overwrite the content of the eclipse.classpath file with the content of .classpath, restart eclipse after the replacement, and then the package structure will be normal
5. Introduce the downloaded dependency jar, the jars in each subdirectory of the %eclipse_workspace%\jmeter_leocnx\MyJmeter\lib directory must be imported
First remove the dependencies with these path errors
6. Copy the jmeter.properties and log4j2.xml files from the source bin directory to the %eclipse_workspace%\jmeter_leocnx\MyJmeter\bin directory:
Then Run As is configured as follows: NewDriver is the jmeter entry class
7.Ant build
8. Run NewDriver, jmeter is running