Saturday, August 4, 2018

How to install JDK and setup JAVA_HOME in Windows 10

Step 1. Check if you already installed JDK or JAVA_HOME


Open Command Prompt by hit Window + R keys, type CMD

Screenshot_2
Java and JAVA_HOME were not setup

If you have a screen likes above, you are probably needed to install JDK and setup JAVA_HOME variable

You can also check if you had installed by checking in explore

C:\Program Files\Java 

If you have a screenshot likes below, you can skip Step 2.

[caption id="attachment_200" align="alignnone" width="1298"]Screenshot_7 Installed JDK version 1.8.0.181[/caption]

Step 2.  Install JDK


Open Google and search for "JDK download"

[caption id="attachment_194" align="alignnone" width="1258"]Screenshot_1 Choose URL with www.oralce.com[/caption]

Download JDK 8 version, it is optional to choose JDK version, at the time of this article JDK 8 is best suitable for development

[caption id="attachment_197" align="alignnone" width="1681"]Screenshot_4 Choose JDK 8[/caption]

Install by click on downloaded JDK

[caption id="attachment_196" align="alignnone" width="1200"]Screenshot_3 Install the JDK after download finished[/caption]

Noted the location of JDK

[caption id="attachment_198" align="alignnone" width="1103"]Screenshot_5 Note the location of JDK[/caption]

It may requires to install JRE, we will install the JRE also.

[caption id="attachment_199" align="alignnone" width="1583"]Screenshot_6 Install JRE also.[/caption]

Installed successfully.

[caption id="attachment_201" align="alignnone" width="832"]Screenshot_8 Installed successfully[/caption]

3. Register java and JAVA_HOME to environment variables.


Open Explored, right click on This PC and choose Properties

[caption id="attachment_202" align="alignnone" width="740"]Screenshot_9 This PC --> Properties[/caption]

Choose Advance system sttings:

[caption id="attachment_203" align="alignnone" width="1473"]Screenshot_10 Advanced system settings[/caption]

Choose Environment Variables

Screenshot_11

Now create new variable -

Screenshot_12

Add the JAVA_HOME variable with the value is JDK location in Step 2- C:\Program Files\Java\jdk1.8.0_181

[caption id="attachment_206" align="alignnone" width="1098"]Screenshot_13 Click OK to save the value[/caption]

Edit PATH variable to add java to PATH

Screenshot_14 Choose Path and click Edit[/caption]

The screen depends on Window version, if you are in Window 10, You will have screen like below

Screenshot_15 Click on New to add new Variable[/caption]

Click on new to add new value

Screenshot_16
Click OK to save the value

Now save all the value by hit OK util we exist the Advance system testing screen.

4. Test the result


You should open a new Command Prompt to test the result

Hit Window + R , type CMD and hit Enter

type javac -version and echo %JAVA_HOME%

Screenshot_17

DONE.

No comments:

Post a Comment