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
- Download and Install JDK
- Restart Ranorex Webtestit
Ranorex Webtestit automatically detects your JDK installation and sets the required JAVA_HOME variable path. If you have multiple JDK´s installed, Ranorex Webtestit will use your latest JDK version.
If for some reason, the JAVA_HOME variable was not set automatically, and you get a warning message regarding the variable during project creation, you can set the variable manually by following the instructions below:
Set the JAVA_HOME variable on Windows
After you’ve installed Java in Windows, you must set the JAVA_HOME environment variable to point to the Java installation directory.
To set the JAVA_HOME variable:
- Locate your Java installation directory (It will be something like C:\Program Files\Java\jdk1.8.0_65)
- 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
- Click the Environment Variables button.
- Under System Variables, click New.
- In the Variable Name field, enter JAVA_HOME
- In the Variable Value field, enter your JDK installation path.
- Click OK and Apply Changes as prompted
Open “System Properties”
Open “Environment Variables”
Add System variable “JAVA_HOME”
Restart Ranorex Webtestit
Set the JAVA_HOME variable on MAC OS X
- Open up Terminal.app (Applications >> Utilities >> Terminal)
- Type: emacs .profile
- add this to the end of the .profile file:
- Save and exit emacs (ctrl-x, ctrl-s; ctrl-x, ctrl-c)
- Open a new Terminal window (cmd-n) and type: $JAVA_HOME/bin/java -version
- Restart Ranorex Webtestit
To install JDK and configure JAVA_HOME variable on Linux
- Download the appropriate version of JDK from here
- Create a folder in which you want to install JDK and move the downloaded JDK installation file there.
- Open Terminal and navigate to your install folder.
- In Terminal, type in next lines :
- If you downloaded the tar.gz archive: tar zxvf (downloaded package name) for example
tar zxvf jdk-8u181-linux-x64.tar.gz
- If you downloaded the .rpm file : rpm -ivh (downloaded package name) for example
rpm -ivh jdk-8u181-linux-x64.tar.gz
After this, you should see the installation progress and JDK should now be installed.
To set the JAVA_HOME path:
- If you don’t have it, install a nano text editor
- Open the terminal and type in:
sudo nano /etc/environment
- Add following lines to the document:
JAVA_HOME= (enter here the location where you have installed JDK)
- Save the file.
- Lastly, reload the system PATH with the following command:
$ . /etc/environment
The JAVA_PATH should now be set. Type:
echo $JAVA_HOME to verify it.