The JAVA_HOME variable should point to the JDK’s bin folder in order for Java applications (jar, war, etc) to know where Java lives.
To setup a JAVA_HOME environment variable on Windows.
- Right click on the My Computer icon in the start menu or on the desktop and select properties
- Click the Advanced Tab
- Click the Environment Variables button
- Under System Variable, click New
- Enter the variable name as JAVA_HOME
- Enter the variable value as the install path for the Development Kit
- Click OK
- Click Apply Changes
Word of caution, Java is not fond of spaces, so I use pathnames without spaces.
Note: You will need to click OK, apply changes AND reload cmd to see the changes there.