How to setup the Java JDK for use with Ranorex Webtestit


#1

Note: since JDK version 9 and 11 are not currently supported for building Selenium, we strongly advise you to install and use the JDK 8 version. Otherwise, you might end up with an error when trying to execute your tests. You can find more information about this here

Note: since the Oracle version of JDK version 8 is now subject to new licensing terms, in this article we recommend, and show, how to set up OpenJDK instead.

  1. Download and Install OpenJDK
    On Linux you can also install OpenJDK via terminal apt install openjdk-8-jdk
  2. Restart Ranorex Webtestit

You should now be set! Ranorex Webtestit automatically detects your JDK installation and sets the required JAVA_HOME variable path internally. If you have multiple JDK´s installed, Ranorex Webtestit will use your latest JDK version.

If for some reason, your JDK installation was not found and you get a warning message regarding the variable during project creation, you can set the variable manually by following the instructions below:

Setting JAVA_HOME on Windows

After you’ve installed Java on Windows, you must set the JAVA_HOME environment variable to point to the Java installation directory.

To set the JAVA_HOME variable:

  1. Locate your Java installation directory (It will be something like C:\Program Files\Java\jdk1.8.0_65)
  2. Do one of the following:
    Windows 7 – Right-click My Computer and select Properties > Advanced
    Windows 8 – Go to Control Panel > System > Advanced System Settings
    Windows 10 – Search for Environment Variables then select Edit the system environment variables
  3. Click the Environment Variables button.
  4. Under System Variables, click New.
  5. In the Variable Name field, enter JAVA_HOME
  6. In the Variable Value field, enter your JDK installation path.
  7. Click OK and Apply Changes as prompted

Screenshots:

Open “System Properties”

Open “Environment Variables”

image

Add System variable “JAVA_HOME”

Restart Ranorex Webtestit

More information on setting JAVA_HOME on Windows.

Set JAVA_HOME on MacOS

  1. Open up Terminal.app (Applications >> Utilities >> Terminal)
  2. Type: emacs .profile
  3. Add these lines to the end of the file:
    JAVA_HOME=/Library/Java/Home
    export JAVA_HOME;
    
  4. Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
  5. To verify, open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version
  6. Restart Ranorex Webtestit

Setting JAVA_HOME on Linux

  1. If you don’t have it, install a nano text editor
  2. Open the terminal and type in:
    sudo nano /etc/environment
  3. Add the following lines:
    JAVA_HOME=<path to the location where you have installed JDK>
    export JAVA_HOME
    
  4. Save the file.
  5. Lastly, reload the system PATH with the following command:
    $ . /etc/environment
  6. Verify by typing echo $JAVA_HOME
  7. Restart Ranorex Webtestit

Unable to import Java Packages
Couldn't update test report
Running Ranorex Webtestit in Jenkins for Continuous Integration
Creating a new project: Installing Node.js link points to wrong setup guide
Running Ranorex Webtestit in TFS/VSTS for Continuous Integration