1

I have written a test plan in JMeter which works fine when run through JMeter UI or Windows command line. However, if I make a task in windows scheduler and try to run it, I get following error message:

Not able to find Java executable version. Please check your Java installation. errorlevel=2

I am providing complete path to JMeter.bat file while creating the task.

What could be the possible reason for this error?

Thanks

  • Have you seen [this](http://stackoverflow.com/questions/20717051/i-am-trying-to-open-jmeter-by-the-batch-file-but-it-gives-me-a-windows-error) maybe? – Iske May 12 '17 at 08:24
  • I have seen this but it talks about Path variable. My Path is set already and JMeter runs perfectly when I run it through its UI or through command line. I am getting this error when I put following command in scheduler: ```D:\D\Software\JMeter\apache-jmeter-2.13\bin\jmeter.bat -n -t E:\Personal\VISP\Performance\UBO8_PerformanceTest_v1.jmx -l testresults.jlt``` – Ehtesham Ahmed May 12 '17 at 09:01
  • The above command works perfectly on command line – Ehtesham Ahmed May 12 '17 at 09:03
  • Why do you have 2 D (drive letters)? D:\Software\...\jmeter.bat should work. – Iske May 12 '17 at 09:09
  • Actually D is a folder on D drive :) – Ehtesham Ahmed May 12 '17 at 10:03
  • Nice! :-) It must be some java path issue... Did you set good privileges for .bat file? – Iske May 12 '17 at 10:28
  • Priviledges are all set but this error is weird. The same jmeter.bat file runs well when executed through cmd or jmeter UI but throws java error when executed through RUN or task scheduler – Ehtesham Ahmed May 12 '17 at 10:52

1 Answers1

0

Finally, I figured it out. The root cause is that I was maintaining two versions of Java on my machine i.e. 1.7 and 1.8 although PATH and JAVA_HOME variables were pointing to 1.8. By trying different options with PATH and JAVA_HOME variables, I ran into further problems - Now, I was no more able to even run JMeter UI by double clicking jmeter.bat file as I started facing same error (Initially, I was able to run .bat file by double-click). I uninstalled and re-installed Java 1.8 but issue stood still.

On further investigation, I realized that maintaining two versions could be the root cause and on doing further research I came to know that I have to remove all java.exe, javaw.exe, and javaws.exe from Windows\System32 and Windows\SysWOW64 folders. By following this solution, my issue is resolved completely and testplan is being executed as scheduled task.

Ref: Registry key Error: Java version has value '1.8', but '1.7' is required

Community
  • 1
  • 1