Installing the JDK Software and Setting JAVA_HOME
...
- Download and Install the JDK software.
Select the appropriate JDK software (Java 14, 11 or 8) and click Download.
The JDK software is installed on your computer, for example, at C:\Program Files\Java\jdk1.8.0_231.
- Set JAVA_HOME:
- Right-click on My Computer and select Properties.
- On the Advanced tab, select Environment Variables.
- Under “System variables” click the “New…” button and enter JAVA_HOME as “Variable name” and the path to your Java JDK directory under “Variable value”.
- Update PATH
- In “Environment Variables” window under “System variables” select Path > click on Edit.
- In “Edit environment variable” window click “New”
- Type in
%JAVA_HOME%\bin
- Open terminal and type java -version . The output should look like :
- java version "1.8.0_151"
- Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
- Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
...