krishna moorthy
krishna moorthy

Reputation: 369

JMETER_HOME environment variable is not defined correctly but build is successful and the script works fine in Jmeter GUI and cmd prompt

I have created a jmeter jmx script and it is getting executed perfectly in GUI and non GUI mode. I have configured the same in Jenkins but I am getting the build success with an error message as "The JMETER_HOME environment variable is not defined correctly This environment variable is needed to run this program"

I have also tried setting the JMETER_HOME as E:\apache-jmeter-4.0 in User variables and Path as E:\apache-jmeter-4.0\bin in System Variables and it didn't work.

I tried the below Questions but no luck.

'jmeter' is not recognized as an internal or external command, operable program or batch file

JMETER_HOME environment variable is not defined

Here is my command and error from jenkins

E:\apache-jmeter-4.0\bin\jmeter -jjmeter.save.saveservice.output_format=xml -n -t E:\JMeter Tutorial\JenkinsIntegration.jmx -l E:\JMeter Tutorial\JenkinsIntegrationResult.jtl

enter image description here enter image description here

Upvotes: 0

Views: 1592

Answers (2)

krishna moorthy
krishna moorthy

Reputation: 369

I removed Jenkins and reinstalled as well as i deleted the old job and created a new job with default settings in jenkins (i dint do anything in the manage Jenkins) and it worked charm with both jmerer 4.0 and 5.3. java 1.8.0_251

enter image description here

with 5.3 enter image description here

with 4.0 enter image description here

as far i remember i just removed the space and added underscore in the below command from folder name JMeter Tutorial to Jmeter_Tutorial

E:\apache-jmeter-4.0\bin>E:\apache-jmeter-4.0\bin\jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t E:\JMeter_Tutorial\JenkinsIntegration.jmx -l E:\JMeter_Tutorial\JenkinsIntegrationResult.csv

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168092

The easiest way of setting an environment variable is defining it under Manage Jenkins - Configure System - Global properties:

enter image description here

The better way would be using Environment Injector plugin

And last but not the least, you're getting this message because you're sitting at outdated JMeter 4.0, if you upgrade to i.e. JMeter 5.2.1 you won't be seeing this warning, moreover according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article you should always be using the latest version of JMeter so in any case upgrade does make sense, check out what is the latest stable JMeter version and switch to it

Upvotes: 0

Related Questions