Open Windows Explorer.
In the navigation pane on the left right click on This PC (or Computer for older Windows versions). There is a shorter way without using the explorer in actual Windows versions: Just press Win+Pause
SystemPropertiesAdvanced (case insensitive) in the Run (Win+R), and hit Enter.
In the Advanced tab of System Properties select the Environment Variables... button in the lower right corner of the window.
Add a New System Variable by clicking the New... button in System Variables with the name
JAVA_HOME and whose value is the path to the directory where the JDK was installed. After entering these values, press OK.
Scroll down the list of System Variables and select the
CAUTION: Windows relies on
Pathto find important programs. If any or all of it is removed, Windows may not be able to function properly. It must be modified to allow Windows to run the JDK. With this in mind ,click the "Edit..." button with the
Pathvariable selected. Add
%JAVA_HOME%\bin;to the beginning of the
It is better to append at the begining of the line because Oracle's software used to register their own version of Java in
Path - This will cause your version to be ignored if it occurs after Oracle's declaration.
javac -versioninto the prompt. If it was successful, then the version of the JDK will be printed to the screen.
Note: If you have to try again, close the prompt before checking your work. This will force windows to get the new version of