{"id":782,"date":"2016-04-16T12:26:56","date_gmt":"2016-04-16T12:26:56","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=782"},"modified":"2023-06-19T09:15:01","modified_gmt":"2023-06-19T09:15:01","slug":"how-to-add-jmeter-to-the-path-environment-variable-on-mac-os-x","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2016\/04\/how-to-add-jmeter-to-the-path-environment-variable-on-mac-os-x","title":{"rendered":"How to Add JMeter to the PATH Environment Variable On Mac OS X"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 2<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span><!-- pn-tldr --><h2>Key takeaways<\/h2><ul><li>Adding JMeter to PATH means you can run it from any directory rather than its install folder.<\/li><li>Put the export in your shell profile so it survives a new terminal session.<\/li><li>Confirm with which jmeter rather than assuming the edit took effect.<\/li><\/ul><!-- \/pn-tldr --><p class=\"lead\">In case you want to easily start <strong>Apache JMeter<\/strong> load testing tool on your <strong>MAC OS<\/strong>, here some things which you help you get started.<\/p>\n<p>Once you downloaded Apache JMeter, just go to the <strong>PATH<\/strong> where you&#8217;ve dowloaded it. For example, I&#8217;ve downloaded JMeter in my Downloads folder. Here are\u00a0full details on how to <a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/13\/how-to-use-apache-jmeter-to-load-test-a-web-server\/\">run your first load test with JMeter<\/a>.<\/p>\n<p>Steps to Add JMeter to the PATH environment variable:<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Open <strong>Command-Line<\/strong> (Terminal)<\/li>\n<li>Type <strong>jmeter<\/strong> and press <strong>Enter<\/strong><\/li>\n<li>If <strong>JMeter<\/strong> is not in the <strong>PATH<\/strong> <strong>variable<\/strong>, you&#8217;ll get the following:\n<pre class=\"lang-java\"><code>\n-bash: jmeter: command not found\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>[emaillocker id=&#8221;1703&#8243;]<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>In terminal, go to the <strong>bin<\/strong> folder, where you&#8217;ve downloaded JMeter<\/li>\n<li>Press <strong>pwd<\/strong> command to get the current working directory<\/li>\n<li>Update the <strong>PATH variable<\/strong> with the following command:\n<pre class=\"lang-java\"><code>\nexport PATH=$PATH:\/Users\/user\/Downloads\/apache-jmeter-2.13\/bin<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>li&gt;Now type <strong>jmeter<\/strong> in the terminal and Apache JMeter will start<\/p>\n<p>This is what you should see in your terminal:<\/p>\n<pre class=\"lang-java\"><code>\ncomputer:bin user$ jmeter\n-bash: jmeter: command not found\ncomputer:bin user$ pwd\n\/Users\/user\/Downloads\/apache-jmeter-2.13\/bin\ncomputer:bin user$ export PATH=$PATH:\/Users\/user\/Downloads\/apache-jmeter-2.13\/bin\ncomputer:bin user$ jmeter\norg.apache.jmeter.testelement.TestPlan\norg.apache.jmeter.control.gui.TestPlanGui\n<\/code>[\/emaillocker]<\/pre>\n<p>With\u00a0<a href=\"https:\/\/loadfocus.com\/jmeter-load-testing\">JMeter Cloud Load Testing Tool<\/a>\u00a0from\u00a0<a href=\"https:\/\/loadfocus.com\/\">LoadFocus<\/a>, you can upload your Apache JMeter test scripts (.jmx files), run and analyze JMeter results from multiple world locations, everything in an easy to use UI.<\/p>\n\n\n<p><em>Written by&nbsp;<a href=\"https:\/\/coursinator.com\/instructor\/bogdan-vazzolla\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"broken_link\">Bogdan&nbsp;Vazzolla<\/a>.<\/em><\/p>\n\n\n\n<p><em><a href=\"https:\/\/loadfocus.com\/\">LoadFocus<\/a>\u00a0is a cloud testing platform,\u00a0a\u00a0<a href=\"https:\/\/loadfocus.com\/load-testing\" target=\"_blank\" rel=\"noreferrer noopener\">load and stress testing tool<\/a>\u00a0which provides the infrastructure to run tests with thousands of concurrent users, from\u00a0<a href=\"https:\/\/loadfocus.com\/locations\">multiple cloud locations<\/a>, in less than a few minutes, keep history of the results, compare different runs to inspect performance improvements or performance degradation.<\/em>\u00a0<em>It also supports running\u00a0<a href=\"https:\/\/loadfocus.com\/jmeter-load-testing\" target=\"_blank\" rel=\"noreferrer noopener\">JMeter load tests from the cloud<\/a><\/em>\u00a0and\u00a0<a href=\"https:\/\/loadfocus.com\/page-speed-monitoring\" title=\"\">monitoring and audit web and mobile performance<\/a>.<\/p>\n<!-- pn-faq --><h2>Frequently Asked Questions<\/h2><h3>Why add JMeter to PATH?<\/h3><p>So you can start it from any directory instead of navigating to the install folder every time. It also makes JMeter usable from scripts and CI steps without hardcoding a path.<\/p><h3>Why does it stop working in a new terminal?<\/h3><p>Because the export only applied to that session. Put it in your shell profile so it is set for every new terminal, otherwise it disappears when you close the window.<\/p><h3>How do I confirm it worked?<\/h3><p>Run which jmeter and check the path it prints. Assuming the edit took effect is how people end up debugging the wrong installation.<\/p><!-- \/pn-faq --><!-- pn-related-reading --><h2>Related reading<\/h2><ul><li><a href=\"https:\/\/loadfocus.com\/blog\/2021\/06\/how-to-create-an-alias-to-easily-start-jmeter-on-your-local-machine\">Create an Alias to Start JMeter Locally<\/a><\/li><li><a href=\"https:\/\/loadfocus.com\/blog\/2014\/06\/run-apache-jmeter-on-mac\">Run Apache JMeter on Mac<\/a><\/li><li><a href=\"https:\/\/loadfocus.com\/blog\/2020\/09\/where-to-find-the-configuration-files-for-jmeter-when-installed-with-homebrew\">JMeter Configuration Files With Homebrew: Where to Look<\/a><\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 2<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span>Key takeaways Adding JMeter to PATH means you can run it from any directory rather than its install folder. Put the export in your shell profile so it survives a new terminal session. Confirm with which jmeter rather than assuming the edit took effect. In case you want to easily start Apache JMeter load testing&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/how-to-add-jmeter-to-the-path-environment-variable-on-mac-os-x\" class=\"more-link\" title=\"Read How to Add JMeter to the PATH Environment Variable On Mac OS X\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3681,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9],"tags":[130,131],"class_list":["post-782","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-jmeter","category-load-testing","tag-add-jmeter-to-path","tag-update-path-env-var"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/comments?post=782"}],"version-history":[{"count":1,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions"}],"predecessor-version":[{"id":2605,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions\/2605"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/3681"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}