-2

I have a problem that with my automation script where it needs to get the JRE Root path for java versions. I managed to get the path for java 8 and java 11 using java -verbose -version

enter image description here

but i cant get anything for java 17 using the same command

enter image description here

Below is the Jython script that i used to configure the JRE Root Path START SHELL COMMAND "java -verbose -version | findstr /I "[Opened opened:"" WAIT RETURNSTDOUT enter image description here

It's working for java 8 and java 11 and i wanna be able to use the same script for java 17. Can anybody help me?

I tried with 'where javac' but it's not working with my Jython script

  • 2
    Hy, welcome to Stack Overflow, please [don't upload text, table or error message as image](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors/285557#285557). Edit your question to contain all the information in text form - consider to use the editor's formatting options. Also see [How to Ask](https://stackoverflow.com/help/how-to-ask) – Daxelarne Mar 09 '23 at 10:32
  • (1) If I remember correctly, JDK 17 does not have a so-called `jre` directory (2) You can try to find the environment variable `JAVA_HOME` or `PATH` – life888888 Mar 09 '23 at 10:54

2 Answers2

0

I tried with 'where javac' but it's not working

javac is the compiler (part of JDK). You can try just 'where java' to get the path to JRE currently in use.

Mar-Z
  • 2,660
  • 2
  • 4
  • 16
0

if you are using QF-Test and want fetch this Information via a Groovy or Jython Script, you may check the Variable Groups descibed under "External data and special groups" in the Manual. Perhaps something will help you.

Cheers, Plamen

buda
  • 13
  • 4