How to resolve the error “Unable to access jarfile ApacheJMeter.jar errorlevel=1” while initiating Jmeter?

前端 未结 13 559
谎友^
谎友^ 2020-12-16 09:50

Download Jmeter and execute the batch file (Jmeter\\apache-jmeter-2.6\\bin\\jmeter.bat).
We get the error message in the console:

Unable to access jarfil         


        
相关标签:
13条回答
  • 2020-12-16 10:21

    I'm running JMeter 2.8 (Windows 7) and received a message similar to that in the original post:

    C:\>jmeter
    Error: Unable to access jarfile C:\local\software\jMeter\apache-jmeter-2.8\binApacheJMeter.jar
    errorlevel=1
    Press any key to continue . . .
    

    I'd created a Windows environment variable JMETER_BIN and set it to the JMeter path which I could see contained ApacheJMeter.jar (so it wasn't a question that the jar was missing).

    I should have noticed at the time this portion of the error: "binApacheJMeter.jar"

    When I went to the jmeter.bat file to troubleshoot, I noticed this line:

    %JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%
    

    and that caused me to revisit the "binApacheJMeter.jar" portion of the error.

    What was happening was that the batch file was requiring a trailing slash on the end of the path in the JMETER_BIN environment variable to correctly specify the location of the .jar.

    Once I corrected my environment variable, adding the trailing slash, all was wonderful.

    YMMV, but this worked for me.

    0 讨论(0)
提交回复
热议问题