If you have already installed Java on Windows systems. Then you need to set JAVA_HOME environment variable to make it working properly. Additionally, you also need to add java bin folder location in PATH environment variable. This tutorial will help you to set JAVA_HOME on Windows 7/8/10 operating systems.
Step 1. Edit Environment Variable Dialog
You can set environment variable by opening system properties dialog blog.
- Type sysdm.cpl on run window or Right-click on My Computer and select Properties.
- Go to Advanced tab.
- Click Environment Variables… button.
Step 2. Set JAVA_HOME Variable on Windows
Now click on New button under system variables. An input dialog will open. Enter following details. The variable value may differ as per installed Java version.
Variable name: JAVA_HOME Variable value: C:\Program Files\Java\jdk1.8.0_121
Step 3. Set Path Variable on Windows
Additionally, You will also be required to add bin location of your java binaries to systems Path variable. Edit PATH variable under system variables and append string ;%JAVA_HOME%\bin in variable value and save it.
Step 4. Verify Settings
Finally, you may need to verify all settings. To verify, open command prompt and type below commands to check JAVA_HOME and Path environment variables values.
echo %JAVA_HOME%C:\Users\Rahul> path
The result will will be something like below.