Skip to main content

Set a new default JRE for test projects in Katalon Studio

You can set your desired JRE package as the default one to compile and run test projects. You can also override the default configuration in console mode by using the environment variable.

Katalon Studio version before 9.0.0 uses the default embedded Java Runtime Environment (JRE) v8 to run a Katalon Studio instance and compile test projects.

From version 9.0.0 onwards, Katalon Studio only supports default JRE from v17.

Note:
  • This change applies to the JRE used to run your test projects, not the JRE used to run Katalon Studio.
  • When updating from previous versions to 9.0.0, you need to remove default JRE and update any imported libraries in order to use Katalon Studio as normal. For further instruction, refer to Add external libraries to a project.
This guide takes you through the steps to:
  • Set a new default JRE for a Katalon Studio instance.
  • Apply the new JRE to a test project.
  • Run tests with another JRE in the command line.

Set a new default JRE for a Katalon Studio instance

  • For Katalon Studio 7.9.0 to 8.6.8: The desired JRE version (from 8 to 14) installed on your machine.
  • For Katalon Studio 9.0.0 and later: The desired JRE version (from 17 onwards) installed on your machine.
You need to set your desired JRE as the default JRE in Katalon Preferences. In this example, we set JRE 11 as the default one. Do as follows:
  1. Go to Katalon Studio > Preferences > Java > Installed JREs.
  2. Click on the button Add....
  3. In the Add JRE dialog, select Standard VM.
  4. Browse to the Home folder of the JRE you wish to add and give it a name. Here, we name it JRE 11. Click Finish.
  5. In the Installed JREs section, check the newly added JRE to set it the default one.
  6. Click Apply & close.

Use the newly added JRE in a test project

To run a test project with the new JRE, do as follows:
  1. Download jaxb-api-2.3.1.jar library. You can download JAXB API 2.3.1 from the Maven Repository website here: JAXB API 2.3.1.
  2. Add the jaxb-api-2.3.1.jar library to your test project. To do so, you can follow the instructions in this document: Add an external library to a project.
    Note:
    • The JRE version used to run test projects and JRE compiler compliance level should be compatible. For instance, Java 8 test projects are compatible with the default JRE compiler level 1.8. To alter JRE compiler compliance level, go to Preferences > Java > Compiler.
    • In case you want to check which Java version the test project is developed with, add the following script to a test case, then run it and see the log.
    println System.getProperty('java.version')

Run tests with another JRE in the command line

Important:
  • For Katalon Studio 7.9.0 to 8.6.8: The desired JRE version (from 8 to 14) installed on your machine.
  • For Katalon Studio 9.0.0 and later: The desired JRE version (from 17 onwards) installed on your machine.
  • An active KRE license. To learn more about activating licenses, you can refer to this document here: Katalon Runtime Engine license overview.
To execute a test suite or a test suite collection with another JRE in console mode, you need to add the KATALON_JAVA_HOME= <JRE_location> environment variable and use it before Katalon commands. Below is a sample command on macOS and Linux for your reference:
export KATALON_JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home.
./katalonc ...