Search code examples
apachejmeterperformance-testingload-testing

JMeter unknown arg ?t


I'm trying to run JMeter in non-gui mode (from the command line).

I've seen in a number of places, including the official docs, that this following command will do what I want:

jmeter -n –t test.jmx -l testresults.jtl

However, I get an illegal argument exception for the "t" argument. See below for my console output:

Console screenshot showing output from the command

Below is the output saved to jmeter.log:

2016/08/09 14:41:59 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_GB 
2016/08/09 14:41:59 INFO  - jmeter.JMeter: Loading user properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\user.properties 
2016/08/09 14:41:59 INFO  - jmeter.JMeter: Loading system properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\system.properties 
2016/08/09 14:41:59 FATAL - jmeter.JMeter: An error occurred:  java.lang.IllegalArgumentException: Unknown arg: –t
    at org.apache.jmeter.JMeter.initializeProperties(JMeter.java:746)
    at org.apache.jmeter.JMeter.start(JMeter.java:385)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:259)

Solution

  • So the issue was how I was getting the command into the command line.

    When I copied and pasted my command, it was copied from a webpage, into notepad, and then into the command line. I wrongly assumed notepad would encode the correct character.

    Just a bit confusing as the -n worked but not -t. Silly error!