Setting the path and environment variables will differ depending on the version of Windows you have on your computer. These instructions were designed for Windows 11.
Administrator privileges are required to modify the path and environment variables.
To set the JAVA_Home path and add the bin path:
-
Open the Windows Control Panel.
-
Enter environment variables in the search bar.
-
Click Edit the system environment variables.
-
In the System Properties dialog box, click Environment Variables.
The Environment Variables dialog box opens.
-
Edit or create the JAVA_HOME variable and set it to your jdk folder address.
-
If you do not see the JAVA_HOME variable listed under System variables:
-
Below the System variables window, click New.
-
In the New System Variable dialog box:
-
In Variable name enter JAVA_HOME.
-
In Variable value, enter the address of the folder you created for jdk.
-
Click OK.
-
If you see the JAVA_HOME variable listed under System variables:
-
In the System variables box, click JAVA_HOME, and then click Edit.
The Edit System Variable dialog box opens.
-
Change Variable value to the address of the folder you created for jdk, and click OK.
-
If the value appears correctly in the Environment Variables dialog box, click OK.
-
Now add the bin path to the Path variable.
-
Click and edit the Path variable which also appears in System variables:
-
In the Edit environment variable dialog box, add the OpenJDK bin path. It is the JAVA_HOME path with \bin appended to the end, for example:
C:\jdk-17\bin
-
Click OK in each dialog box until you exit the Windows Control Panel.