1) Download Java JDK Installer for windows host.
Java SE Development Kit 9 Downloads
2) Install Java 1.8 by clicking on Java jdk installer.
3) Click on Next button and select the features in custom setup.
4) Click on Next button once selected features to install.
5) Click on Next button and select the folder to install java.
6) Click on Next button and java installation will be in progress.
7) Click on Close button once java 1.8 installation is completed.
7) Goto 'System Properties' in Control Panel under System and Security and click on Advanced tab.
8)Click on Environment variables and edit path variables for java 1.8 as below in system variables section.
9) Open command prompt and run java --version command, should display below output if java environment variables are added correctly. We can also check javac command is working or not.
10)Once installed java, set the path to access java commands in all the path's.
E:> set path=D:\Program Files\Java\jdk-10.0.2\binSuppose java bin directory path is 'D:\Program Files\Java\jdk-10.0.2\bin'
Run java or javac command to check whether java is working or not.
Suppose command is not found, then java isntallation is not done correctly.