Sunday, November 12, 2017

How to Setup Java Environment in Windows 10

If you already have downloaded Java Development Kit (JDK), then you are very close to execute and run your java program. Your next step to setup java environment variable and in this tutorial we are going to configure this on Windows 10.

We tested this configure using:

a) Window 10 and Window 7
b) JDK 1.8

1. Configure JAVA_HOME:

Go to search window and type advanced system setting and click ‘View advanced system settings’.

You can view ‘System Properties’ window and click ‘Environment Variables..’

In the system variables section, click ‘New..’

In System Variable, Add new variable JAVA_HOME and set your JDK installation path as value.

In my case, JDK installation path is: C:\Program Files\java\jdk1.8.0_60

Important note:

Don’t include \bin at the end of the path

C:\Program Files\java\jdk1.8.0_60\bin –
is wrong.
C:\Program Files\java\jdk1.8.0_60 – is correct.

2. Configure Path variable:

Our next task is to add a Path variable. In System variable find ‘Path’ click on this and click edit.

    Append %JAVA_HOME%\bin at the end.

Note: Putting JAVA_HOME\bin in PATH ensures that you can access java command from anywhere at your system.

Press OK
Close all the windows by clicking OK

3. Testing

Now to check everything is fine.

Go to command prompt and type Java –version and then press enter

No comments:

Post a Comment