Transferred from Mr. Tao (https://www.cnblogs.com/taoSir/p/5144274.html)
Due to the JMeter pure Java development, the interface is also based on swing or AWT, so want to know more deeply about this tool or for children who want to understand the development of JMeter plug-in or two times development of children's shoes, read jmeter Source estimation is essential, So first we have to integrate the source code to facilitate the debug and two development, the following collation of the JMeter source code integration into the eclipse of a process, we hope to have some help.
1. Download the source file first: http://jmeter.apache.org/download_jmeter.cgi
2. Then extract the downloaded source files to the local road under the strength;
3. Open Eclipse, create a javaproject, and follow the build javaproject below;
4. Select the Java project you created, right-click Import, and select "File System"
5. Locate the JMeter source file under local road strength and select Import All
6. After the import is complete, look at the project, all the red X, this is too distressing, cause the error is not imported the corresponding jar package,
7. We can use ant to download the jar files required for the project, the following steps:
eclipse–> window–> Show view–> ant, add ant to Eclipse's control Panel,
Then select Add Buildfiles on the ant panel;
8. Select ant's Build File "Build.xml" under this project
9. On the Ant page, double-click "Download_jars", this time the ant run automatically download the default jar file to the path specified under the project, until the build Success (this process may have some problems, because the network is limited, some jar packages can not be downloaded, May need to FQ, if you do not want to trouble, I will directly upload the required jar package to the cloud disk, directly drop the jar package to Lib)
After the jar package has been downloaded or the jar package has been copied directly to the Lib folder, right-click on the project build path–> Configure Build Path and select "Add Jars"
All of the following Lib jar packages are imported into the project, jar package in the directory structure below Lib as shown, this can not be wrong (if it is downloaded with ant, the directory structure is created, if you download the jar package imported, you must pay attention to the directory structure under Lib).
Jar Package: https://yunpan.cn/crdkymEH8hD49 (Extract code: 3B14)
11. Once the import is successful, you can see that all the evil red X are gone, but this time the project is not running successfully, and you need to do the following
12. Close Eclipse and go to the local folder of the Java project, you need to delete the original ". Classpath" and rename "Eclipse.classpath" to ". Classpath", due to the limitations of Windows itself, So you need to go to cmd below to do the corresponding operation, as shown in:
13. Once the above operation is complete, reopen Eclipse and locate the entry for the project, Main method,/jmeter/src/core/org/apache/jmeter/newdriver.java
Run the project found or error, as shown, a variety of Google, all kinds of attempts, are not resolved, in fact, the reason for the error is very clear, is the bin under the lack of "jmeter.properties", never thought Ah, the complete project import why did not the configuration file import it? It is not easy to figure out, as long as the source file in the bin directory to copy the configuration file into the project Bin directory, it solves this problem a big step, the operation as shown:
14. After completion of the above operation, select the project again, right-select Newdriver this main class, select Run As–> run Configuration, according to the following operation, the perfect solution to the above error.
15. Complete all the above operations, you can enjoy the various debug and two development operations.
JMeter source integration into eclipse