Help Center/ CodeArts Repo/ User Guide/ Managing Agent Pools/ Configuring Java Environment Variables on a Windows Host
Updated on 2026-01-28 GMT+08:00

Configuring Java Environment Variables on a Windows Host

  1. Open Control Panel, search for environment variables, and open the System Properties window.
  2. On the Advanced tab, click Environment Variables.
  3. In the System variables area, click New and add the following two variables in sequence.

    Table 1 Creating system variables

    Name

    Value

    CLASSPATH

    .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

    NOTE:

    Do not omit the period (.) in the beginning of the variable value.

    JAVA_HOME

    Enter the Java installation path. For example, C:\Program Files\Java\jdk1.8.0_222. You can search for jdk to determine this path.

  4. In the System variables area, double-click Path. In the dialog box that is displayed, add the variable value %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;.
  5. Click OK.
  6. Open the Git Bash client and enter the java -version command.

    If information similar to the following is displayed, the configuration is successful.

    Figure 1 Checking the Java version