1、首先去github clone源码:https://github.com/apache/jmeter
2、然后下载安装apache ant并配置环境变量:https://ant.apache.org/bindownload.cgi
3、然后根据官网教程:https://jmeter.apache.org/building.html
Once you have downloaded the sources using git or svn, you can setup the Eclipse project by running:
ant setup-eclipse-projectYou can then import the project using File → Import → Existing projects into Workspace and select the folder containing JMeter sources.
在clone下的文件夹下执行命令:ant setup-eclipse-project,这个时间比较长,网络好的话比较快。等待提示成功之后;
4、将目录下eclipse.project 和 eclipse.classpath 这两个文件名字重命名为 .project 和 .classpath;
5、此时打开Eclipse -- File -- Import -- General -- Existing Projects into Workspace 就没有报错成功导入了。
6、打开Eclipse -- Window -- Perspective -- Show View -- Ant,然后在Ant面板,邮件选择Add Buildfiles,选择build.xml,可以看到很多命令
7、这时候运行ant命令 run_gui看看是不是成功运行了jmeter
如果需要使用IDEA,那么正常导入已经搞定的Eclipse工程就可以了。