{"id":835,"date":"2016-05-10T11:27:34","date_gmt":"2016-05-10T11:27:34","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=835"},"modified":"2026-08-29T20:07:28","modified_gmt":"2026-08-29T20:07:28","slug":"how-to-start-apache-jmeter-in-non-graphical-non-gui-mode","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2016\/05\/how-to-start-apache-jmeter-in-non-graphical-non-gui-mode","title":{"rendered":"How to start Apache JMeter in non-graphical (non-GUI) mode?"},"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><p class=\"lead\"><!-- pn-tldr --><\/p>\n<h2>Key takeaways<\/h2>\n<ul>\n<li>Non-GUI mode is the only sensible way to run a real load test.<\/li>\n<li>Pass the test plan and the results file on the command line and let it run headless.<\/li>\n<li>The GUI is for building and debugging plans, not for generating load.<\/li>\n<\/ul>\n<p><!-- \/pn-tldr -->If you want to start Apache JMeter in non-GUI mode, use the following command line options:<\/p>\n<ul>\n<li><em>-n<\/em> &#8211; non-GUI mode &#8211; this specifies JMeter is to run in non-GUI mode<\/li>\n<li><em>-t<\/em> &#8211; JMX file &#8211; location of the test plan and the name of JMX file that contains the Test Plan<\/li>\n<li><em>-l<\/em> &#8211; log file name of JTL file to log sample results to<\/li>\n<\/ul>\n<h3>Example<\/h3>\n<pre>jmeter -n -t my_test_plan.jmx -l log.jtl<\/pre>\n<h4>Optional<\/h4>\n<ul>\n<li><em>-j<\/em> &#8211; name of JMeter run log file<\/li>\n<li><em>-r<\/em>\u00a0&#8211; Run the test in the servers specified by the JMeter property &#8220;remote_hosts&#8221;<\/li>\n<li><em>-R &#8211;<\/em>\u00a0list of remote servers Run the test in the specified remote servers<\/li>\n<li><em>-H &#8211;<\/em>\u00a0proxy server hostname or ip address<\/li>\n<li><em>-P &#8211;<\/em>\u00a0proxy server port<\/li>\n<\/ul>\n<h3>Example<\/h3>\n<pre>jmeter -n -t my_test_plan.jmx -l log.jtl -H my.proxy.server -P 8000<\/pre>\n<h4>Tips for running JMeter in non-GUI mode:<\/h4>\n<ul>\n<li>here are details on <a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/16\/how-to-add-jmeter-to-the-path-environment-variable-on-mac-os-x\/\">how to add <em>jmeter\u00a0<\/em>to the PATH variable<\/a> of your environment<\/li>\n<li>remove any listeners that are GUI mode specific (you can do this by opening your JMX file in GUI mode and remove the GUI specific listeners)<\/li>\n<li>get summary results in the terminal by activating the summary option in the jmeter.properties file<\/li>\n<\/ul>\n<p>Additional scripts that come with Apache JMeter installation can be found in the<em> \/bin<\/em> folder where you&#8217;ve downloaded JMeter.<\/p>\n<h4>For Windows systems:<\/h4>\n<ul>\n<li><em>jmeter-n.cmd<\/em> &#8211; drop a JMX file on this to run a non-GUI test<\/li>\n<li><em>jmeter-n-r.cmd<\/em> &#8211; drop a JMX file on this to run a non-GUI test remotely<\/li>\n<li><em>mirror-server.cmd<\/em> &#8211; runs the JMeter Mirror Server in non-GUI mode<\/li>\n<li><em>shutdown.cmd<\/em> &#8211; Run the Shutdown client to stop a non-GUI instance gracefully<\/li>\n<li><em>stoptest.cmd<\/em> &#8211; Run the Shutdown client to stop a non-GUI instance abruptly<\/li>\n<\/ul>\n<h4>For Unix\/Linux systems:<\/h4>\n<ul>\n<li><em>mirror-server.sh<\/em> &#8211; runs the JMeter Mirror Server in non-GUI mode<\/li>\n<li><em>shutdown.sh<\/em> &#8211; Run the Shutdown client to stop a non-GUI instance gracefully<\/li>\n<li><em>stoptest.sh<\/em> &#8211; Run the Shutdown client to stop a non-GUI instance abruptly<\/li>\n<\/ul>\n<p>The commands will only be accepted if the scripts are run from the same host. Details on <a href=\"https:\/\/loadfocus.com\/blog\/2014\/06\/24\/run-apache-jmeter-on-mac\/\">how to start JMeter on Mac<\/a> system can be found here. Also, here is\u00a0how to load test a website with Apache JMeter.<!-- pn-faq --><\/p>\n<h2>Frequently Asked Questions<\/h2>\n<h3>What are the command line options?<\/h3>\n<p>-n for non-GUI mode, -t for the JMX test plan and -l for the results file. Those three cover a standard headless run.<\/p>\n<h3>Why does non-GUI matter?<\/h3>\n<p>Because the interface consumes the CPU and memory you wanted for generating load. Running headless is the difference between measuring the server and measuring your own machine.<\/p>\n<h3>So what is the GUI for?<\/h3>\n<p>Building and debugging the plan. Use it to get the scenario right, then run the finished plan headless.<\/p>\n<p><!-- \/pn-faq --><!-- pn-related-reading --><\/p>\n<h2>Related reading<\/h2>\n<ul>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2020\/09\/how-to-increase-heap-size-in-jmeter\">How to Increase Heap Size in JMeter?<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2020\/09\/should-i-use-the-jmeter-gui-for-running-the-load-tests-against-my-application-api\">Should You Use the JMeter GUI to Run Load Tests?<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/how-to-use-apache-jmeter-to-load-test-a-web-server\">How To Use Apache JMeter To Load Test a Web Server<\/a><\/li>\n<\/ul>\n<div class=\"custom-callout lf-jmeter-cta\">\n<p class=\"header-title\">Run this JMX in the cloud, from 25+ regions<\/p>\n<p>Upload your JMeter script to LoadFocus and run it with thousands of virtual users from 25+ cloud locations, with no load generators to manage. Results show p95\/p99 response times, throughput and errors per request, and a free tier is included.<\/p>\n<div class=\"buttons\">\n<div class=\"button1\"><a href=\"https:\/\/loadfocus.com\/jmeter-load-testing\" class=\"btn-primary\">JMeter Cloud Load Testing<\/a><\/div>\n<div class=\"button2\"><a href=\"https:\/\/loadfocus.com\/free-api-load-test\" class=\"btn-secondary\">Free API Load Test<\/a><\/div>\n<\/div>\n<\/div>\n","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 Non-GUI mode is the only sensible way to run a real load test. Pass the test plan and the results file on the command line and let it run headless. The GUI is for building and debugging plans, not for generating load. If you want to start Apache JMeter in non-GUI mode, use&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2016\/05\/how-to-start-apache-jmeter-in-non-graphical-non-gui-mode\" class=\"more-link\" title=\"Read How to start Apache JMeter in non-graphical (non-GUI) mode?\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9],"tags":[143,141,142],"class_list":["post-835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-jmeter","category-load-testing","tag-command-to-run-jmeter-in-non-gui-mode","tag-jmeter-in-non-gui-mode","tag-running-jmeter-in-non-gui-mode"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/835","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=835"}],"version-history":[{"count":2,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/835\/revisions"}],"predecessor-version":[{"id":3812,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/835\/revisions\/3812"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/3702"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}