Please note, while changing the environment variables, i did not touch the user variables.. The path in the user variables was left as it is and only the path in the system variables was changed.
In this link, https://coderanch.com/wiki/659740/create-Java-program
the below points left me a little confused..
" You can set environment variables for either your user only, or for all users (System variables). But don't set a user JAVA_HOME and a system PATH (see this discussion). Add a new variable in either of them by clicking the New button.
Set the variable name as JAVA_HOME, and its value to the directory where you installed the JDK (e.g. C:\Program Files\java\jdk1.8.0_172)
Look for a variable called PATH (the name might slightly vary, for example 'Path'). Select it and click Edit. At the beginning of its value, add the following : "%JAVA_HOME%\bin;" (without the double quotations). Don't forget the semi-colon at the end, to separate this directory to the other directories already in the path."
Please clarify If i should alter the path in the user variable also?. Also help me understand what does "Set the variable name as JAVA_HOME, and its value to the directory where you installed the JDK (e.g. C:\Program Files\java\jdk1.8.0_172)" mean?. Where should i be adding "JAVA_HOME"?.