Create Environment Variables for the Java Agent on Windows

The Keyfactor Java AgentClosed The Java Agent, one of Keyfactor's suite of orchestrators, is used to perform discovery of Java keystores and PEM certificate stores, to inventory discovered stores, and to push certificates out to stores as needed. determines the location of the current installed Java version on Windows by checking the Windows system environment variables Path and JAVA_HOME. Depending on how your version of Java was installed, these environment variables may or may not be set.

To check and set the environment variables for the Java Agent install:

  1. Identify your Java base directory (e.g. C:\Program Files\Java\jdk-13.0.2). This directory typically contains the versioning and release files. Copy this path to a text file for easy access.
  2. Identify the location of the Java virtual machine library (e.g. C:\Program Files\Java\jdk-13.0.2\bin\server\jvm.dll), and copy the path to the text file created in the previous step.
  3. Identity the location of the main Java executable (e.g. C:\Program Files\Java\jdk-13.0.2\bin\java.exe), and copy the path to the text file.
  4. As a user with local administrator permissions, use the search function to search for environment and select the option to edit the system environment variables from the search results.

    Figure 538: Search for System Environment Variables

  5. In the System Properties dialog on the Advanced tab, click Environment Variables.
  6. In the Environment Variables dialog in the System variables section at the bottom, scroll down to locate the Path variable, highlight it and click Edit.

    Figure 539: Edit the System Path Environment Variable to Add the Path to Java

  7. In the Edit Environment Variable dialog, click New. On the newly added line, paste the path to the main Java executable (e.g. C:\Program Files\Java\jdk-13.0.2\bin) that you saved earlier (do not include the java.exe part) and click OK.
  8. If it doesn't exist already among the System variables, create the JAVA_HOME environment variable—click New below the System variables box and, in the New System Variable dialog, type JAVA_HOME in the Variable name field and paste the path to the Java base directory in the Variable value field. If the field exists already but with a value that is not correct for the version of Java you wish to use, click Edit and update the Variable value field with the appropriate Java base directory.

    Figure 540: Add JAVA_HOME System Environment Variable

Important:  When you run the install.ps1 script, you may be prompted to input the absolute path to the Java Virtual Machine library. From the text file in which you saved paths, take the path to the Java Virtual Machine library (e.g. C:\Program Files\Java\jdk-13.0.2\bin\server\jvm.dll) and input that string to complete the install.