JMETER_HOME 环境变量定义不正确
当尝试从 java 中的 Maven 项目运行此 jmeter 语句时,我收到此错误。
jmeter -g DIRECTORY -o DIRECTORY
当我在 cmd 中运行它时,它工作正常,但是当我尝试使用以下命令运行它时:
processBuilder.command("cmd.exe","/c","jmeter -g DIRECTORY -o DIRECTORY");
processBuilder.directory(new File("C:\\apache-jmeter-5.3\\bin"));
try {
Process process = processBuilder.start();
它说 JMETER_HOME 环境变量未正确定义
当我运行命令 echo %JMETER_HOME% 时,它返回 C:\apache-jmeter-5.3
我的内容发现奇怪的是,在另一台电脑上一切正常,并且没有定义 JMETER_HOME 变量,所以我尝试从这台电脑上删除该变量,但它不会删除,它没有出现在系统变量窗口中但当我回声时它就在那里。
到底是怎么回事?
提前致谢
I'm getting this error when trying to run this jmeter sentence from a maven project in java.
jmeter -g DIRECTORY -o DIRECTORY
When I run it in cmd it works perfectly but when I try to run it using this:
processBuilder.command("cmd.exe","/c","jmeter -g DIRECTORY -o DIRECTORY");
processBuilder.directory(new File("C:\\apache-jmeter-5.3\\bin"));
try {
Process process = processBuilder.start();
It says The JMETER_HOME environment variable is not defined correctly
When I run the command echo %JMETER_HOME% it returns C:\apache-jmeter-5.3
What I found weird is that in other PC it all works fine and that one doesn't have the JMETER_HOME variable defined, so I tried deleting the variable from this PC but it won't delete, it's not appearing in the system variables window but when I echo it's there.
What is going on?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那么您希望我们在不提供除了不完整代码之外的任何信息的情况下猜测您的一台电脑与另一台电脑之间有什么区别?
我只能说我无法重现您的问题,是的,我没有在任何地方设置
JMETER_HOME
变量。如果您使用 Maven,也许值得考虑查看 JMeter Maven 插件< /a> 可以自动下载JMeter,运行测试并 生成 HTML 报告仪表板。
另请注意,根据 JMeter 最佳实践,您应该使用最新版本JMeter 因此请考虑升级到 JMeter 5.4.3 (或者 JMeter下载页面)下一个可用的机会。
So you want us to guess what is the difference between one your PC and the other one without providing any information apart from incomplete code?
I can only state that I cannot reproduce your issue and yes, I don't have
JMETER_HOME
variable set anywhere.If you're using Maven maybe it worth considering looking at JMeter Maven Plugin which can automatically download JMeter, run the test and generate the HTML reporting dashboard.
Also be informed that according to JMeter Best Practices you're supposed to use the latest version of JMeter so consider upgrading to JMeter 5.4.3 (or whatever is the latest version of JMeter available at JMeter Downloads page) on next available opportunity.
即使我尝试设置该环境变量,我也遇到了未设置 JMETER_HOME 的相同问题。
我试图使用命令提示符在虚拟系统(VM)上启动 Jmeter,但没有成功。
我能够通过以 admin 身份运行命令提示符并启动 Jemter 来解决这个问题,它工作得很好。
注意:确保您已设置 Env。 PATH设置为Jmeter的bin文件夹
I faced same issue of JMETER_HOME not been set, even though I tried setting that Env variable.
I was tying to launch the Jmeter on the Virtual system (VM) using command prompt, and didn't succeed.
I able to solve it by running the command prompt as admin and launching Jemter, it worked fine.
Note: make sure you have the set the Env. PATH set to the bin folder of Jmeter