{"id":2167,"date":"2021-06-01T07:44:39","date_gmt":"2021-06-01T07:44:39","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=2167"},"modified":"2023-09-03T14:09:46","modified_gmt":"2023-09-03T14:09:46","slug":"how-to-create-an-alias-to-easily-start-jmeter-on-your-local-machine","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2021\/06\/how-to-create-an-alias-to-easily-start-jmeter-on-your-local-machine","title":{"rendered":"How to Create an Alias to Easily Start JMeter on your Local Machine"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span><!-- pn-tldr --><h2>Key takeaways<\/h2><ul><li>An alias saves typing the full JMeter path on every launch.<\/li><li>Put it in your shell profile so it persists across sessions.<\/li><li>Point the alias at the version you actually intend to run if several are installed.<\/li><\/ul><!-- \/pn-tldr -->\n<p class=\"lead\"><a href=\"https:\/\/jmeter.apache.org\/\" rel=\"noreferrer noopener\" target=\"_blank\">Apache JMeter<\/a> is a Java-based, open source testing tool, which can help you create and run functional and load tests for Websites, APIs (REST and SOAP) and other web services.<\/p>\n\n\n\n<p>Let me show you my personal configuration and how I start and configure JMeter for a faster and better use on my local machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Run JMeter Locally<\/h2>\n\n\n\n<p>I work on a Mac laptop running <strong>macOS Catalina v.10.15.5<\/strong>, so the configuration is specific for my environment.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Download the JMeter binaries from <a href=\"https:\/\/jmeter.apache.org\/download_jmeter.cgi\" rel=\"noreferrer noopener nofollow\" target=\"_blank\">Apache JMeter Download page<\/a>.<\/li><li>Unarchive the <strong>apache-jmeter-5.4.1.tgz<\/strong> on my local computer by clicking the file I&#8217;ve just downloaded.<\/li><li>I&#8217;m using <a href=\"https:\/\/iterm2.com\/\" rel=\"noreferrer noopener nofollow\" target=\"_blank\">iTerm<\/a> as my macOS Terminal and <a href=\"https:\/\/ohmyz.sh\/\" rel=\"noreferrer noopener nofollow\" target=\"_blank\">Oh My Zsh<\/a> as my Zsh configuration. The configuration for <a href=\"https:\/\/ohmyz.sh\/\" rel=\"noreferrer noopener\" target=\"_blank\">Oh My Zsh<\/a> is kept in the <strong>.zshrc<\/strong> file.<ul><li><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"45\" class=\"wp-image-2171\" style=\"width: 150px;\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo.png\" alt=\"iterm\" srcset=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo.png 1954w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo-800x240.png 800w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo-1280x384.png 1280w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo-600x180.png 600w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo-768x230.png 768w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-logo-1536x461.png 1536w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/li><li><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"93\" class=\"wp-image-2173\" style=\"width: 150px;\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/OMZLogo_BnW.png\" alt=\"OMZLogo\"><\/li><\/ul><\/li><li>Open the configuration file from my terminal with the following command using <strong><a href=\"https:\/\/www.vim.org\/download.php\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Vim<\/a><\/strong> as editom: <ul><li><code>sudo vi ~\/.zshrc<\/code><\/li><li>Press the key <code>i<\/code> to edit the content of the file<\/li><\/ul><\/li><li>Create an alias to the path where you downloaded Apache JMeter, pointing to the <code>\/bin\/jmeter<\/code> path:<ul><li><code>alias jmeter=\"sh \/Users\/user\/Downloads\/apache-jmeter-5.4.1\/bin\/jmeter\"<\/code><\/li><\/ul><\/li><li>Press key <code>Esc<\/code> and type <code>:wq<\/code> in order to write and quit the editor.<\/li><li>In order to apply the new changes present in the Zsh configuration file to our terminal window, we need to source the file manually (this happens automatically when you open iTerm). We source the changes by typing this command in the terminal window:<ul><li><code>source ~\/.zshrc<\/code><\/li><\/ul><\/li><li>And now when you type the alias command added , <code>jmeter<\/code> in our case, will open JMeter GUI.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"432\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias-1280x432.png\" alt=\"iterm-steps\" class=\"wp-image-2172\" srcset=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias-1280x432.png 1280w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias-800x270.png 800w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias-600x202.png 600w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias-768x259.png 768w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/iterm-steps-to-change-alias.png 1506w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><figcaption>Steps to Add Alias from Terminal<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"346\" src=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-1280x346.png\" alt=\"apache-jmeter-started-with-alias\" class=\"wp-image-2170\" srcset=\"https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-1280x346.png 1280w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-800x217.png 800w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-600x162.png 600w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-768x208.png 768w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-1536x416.png 1536w, https:\/\/loadfocus.com\/blog\/wp-content\/uploads\/apache-jmeter-installed-2048x554.png 2048w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><figcaption>Apache JMeter started using an alias from the terminal<\/figcaption><\/figure>\n\n\n\n<p>If you just want to <a href=\"https:\/\/loadfocus.com\/blog\/2014\/06\/run-apache-jmeter-on-mac\/\" title=\"Run Apache JMeter on Mac\">run JMeter on your Mac<\/a>, check our previous article.<\/p>\n\n\n\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\n<hr class=\"wp-block-separator has-text-color has-background has-vivid-purple-background-color has-vivid-purple-color\"\/>\n\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>&nbsp;is a cloud testing platform,&nbsp;a&nbsp;<a href=\"https:\/\/loadfocus.com\/load-testing\" target=\"_blank\" rel=\"noreferrer noopener\">load and stress testing tool<\/a>&nbsp;which provides the infrastructure to run tests with thousands of concurrent users, from&nbsp;<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>&nbsp;<em>It also supports running&nbsp;<a href=\"https:\/\/loadfocus.com\/jmeter-load-testing\" target=\"_blank\" rel=\"noreferrer noopener\">JMeter load tests from the cloud<\/a><\/em>&nbsp;and&nbsp;<a href=\"https:\/\/loadfocus.com\/page-speed-monitoring\">monitoring and audit web and mobile performance<\/a>.<\/p>\n<!-- pn-faq --><h2>Frequently Asked Questions<\/h2><h3>Why bother with an alias?<\/h3><p>It saves typing the full path on every launch, which matters more than it sounds when you start JMeter several times a day while building a plan.<\/p><h3>Why does the alias disappear?<\/h3><p>Because it was only set for that shell session. Put it in your shell profile and it is defined in every new terminal you open.<\/p><h3>What if I have several JMeter versions installed?<\/h3><p>Point the alias explicitly at the one you intend to run. Otherwise you can spend a while debugging behaviour that belongs to a different version than the one you think you are using.<\/p><!-- \/pn-faq --><!-- pn-related-reading --><h2>Related reading<\/h2><ul><li><a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/how-to-add-jmeter-to-the-path-environment-variable-on-mac-os-x\">Add JMeter to the PATH Variable on Mac OS X<\/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\/how-to-install-jmeter-on-mac\">How to Install JMeter on Mac?<\/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\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span>Key takeaways An alias saves typing the full JMeter path on every launch. Put it in your shell profile so it persists across sessions. Point the alias at the version you actually intend to run if several are installed. Apache JMeter is a Java-based, open source testing tool, which can help you create and run&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2021\/06\/how-to-create-an-alias-to-easily-start-jmeter-on-your-local-machine\" class=\"more-link\" title=\"Read How to Create an Alias to Easily Start JMeter on your Local Machine\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2178,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9],"tags":[353,354],"class_list":["post-2167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-jmeter","category-load-testing","tag-add-alias-for-jmeter","tag-start-jmeter-from-terminal"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/2167","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=2167"}],"version-history":[{"count":1,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/2167\/revisions"}],"predecessor-version":[{"id":2752,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/2167\/revisions\/2752"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/2178"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=2167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=2167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=2167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}