JMeter source code into Eclipse and execute

Source: Internet
Author: User

  

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)

10. 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:

11. Import jar Package to Classpath

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).

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 code into Eclipse and execute

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.