问题
Here is the related error its showing:
java.exe is not a recognized file as an internal or external command, operable or external command
errorlevel=9009
回答1:
i was getting the same error on WIndows 8.1(64 bit) and checked java path but it was ok
so i just run my jmeter.bat with Run as Administrator and it worked for me
回答2:
Many operating systems have an environment variable such as PATH
that contains a list of directories (or folders) to be searched when looking for a command to execute. Commands that can be found via the PATH
are commonly called external commands. The program that reads the command line or the batch file and invoked the commands may have a number of built in commands, these are commonly called internal commands.
I suggest you examine the PATH
(or equivalent) set when your java command executes from the command line and also when execution is attempted from the batch file. Compare the two and make sure the directory containing your java.exe
is in the PATH
.
回答3:
Set the correct Java Path (installed in your system) in Computer -> Advanced System settings -> Environment Variables -> Ok -> System Variables -> Path
I got the same issue and resolved by following the above steps.
回答4:
Does not work with Java 9 beta:
Running:
C:\java -version
Gives:
java version "9-ea"
Just go into command line and run:
java -jar ApacheJMeter.jar
回答5:
I tried everything, this eventually worked.
Within System Variables:
PATH = "C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.8.0_101\bin"
May help someone.
回答6:
This error occurs due to the path has not been set properly.
Either you can set it in environmental varialables or right click jmeter .bat file,choose edit set the path their,for reference see the jmeter.apache.org user manuals.
回答7:
For me, my Java path has a space in it and jmeter said it can't find Java
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
.. I looked at the jmeter.sh script and saw it got the path from "Plugin-Ins" .. onward. I tried just commenting out the exit
command after that check in the script .. and then I was able to run jmeter.
So apparently the validation logic has a bug, where the error message about can't find java is in fact not true (if Java is indeed set up correctly), so it can be ignored.
回答8:
For windows 8.1 Users:
Error when trying to run jmeter.bat
Error message:
Not able to find Java executable or version. Please check your Java installation. errorlevel=2 Press any Key to continue
Resolution:
Right Click jmeter.bat and Run as Administrator.
This worked for me, hope this helps. Good luck
回答9:
Set the correct JM_LAUNCH variable to java.exe
回答10:
For Windows XP users set Java environment by following the steps here:
http://www.tutorialspoint.com/jmeter/jmeter_environment.htm
Note the path depends on your installed JDK.
And download the file from:
https://svn.apache.org/repos/asf/jmeter/trunk/bin/jmeter.bat
Then replace your jmeter.bat
with the downloaded file.
回答11:
If you have installed Java and still you get this error, please set the java_home
path to below using typing below command in terminal:
export JAVA_HOME="/Library/InternetPlugIns/JavaAppletPlugin.plugin/Contents/Home"
回答12:
Since I run many versions of Java.. I modified jmeter.bat.
rem JM_START - set this to "start" to launch JMeter in a separate window rem this is used by the jmeterw.cmd script. rem rem =====================================================
setlocal
rem Minimal version to run JMeter set MINIMAL_VERSION=1.8.0 set PATH=%PATH%;C:\Program Files (x86)\IBM\Java80\jre\bin <<< add This line to jmeter.bat
回答13:
Copied the JAVA executable from Installed version of Java from C:\Program FilesJava\jdk1.8.0_191\bin and pasted in the folder where the jmeter bat resides and it worked for me.
回答14:
Not exactly the same issue but somebody might find it helpful
Do not double click jmeter.bat
but instead ApacheJMeter.jar
in the same directory
For me jmeter.bat
run but for a brief moment closing almost immediately and not prompting any error. Above workaround allowed me to start working
来源:https://stackoverflow.com/questions/20717051/i-am-trying-to-open-jmeter-by-the-batch-file-but-it-gives-me-a-windows-error