How to install JDK in Windows.

  1. Download JDK 1.8
  2. Then install JDK by double clicking on the downloaded file.
  3. Select Development Tools and click Next.
  4. Then JDK and JRE will install in C:\Program Files\Java.
  5. Then test whether java installed properly by typing 'java -version' in command prompt. Then it's shown version correctly for me. Then again type 'javac -version'. Then I got an error like 'javac is not recognized as an internal or external command'
  6. To resolve this error, Goto Control panel -> System -> Advanced System Settings -> Environment Variables. Then select 'Path' in the System variables and click 'Edit'.
  7. Then put variable value 'C:\Program Files\Java\jdk-10.0.1\bin' after a semicolon. Do not remove any variable value which already available in Path variable.
  8. Then again test whether java installed properly by typing 'javac -version' in command prompt. Now it's shown the version correctly for me. So I have completed the JDK installation successfully.