Welcome to the Community, @SonarVenkat!
Make sure you have set your JAVA_HOME
variable and add it to your path.
- Click on Windows start button
- Search for “advanced system settings”
- Click on “View advanced system settings”
- Click on “Advanced” tab
- Click on “Environment Variables…” button
- In the “System variables” section, add
JAVA_HOME
environment variable with the name asJAVA_HOME
and value as the exact path to your JDK installation, e.g.C:\Program Files\Java\jdk1.8.0_60
- In the “System variables” section, click on
PATH
and click onEdit...
button - Append
%JAVA_HOME%\bin
to the end of the line. You can use a;
to separate the previous paths. If you are on Windows 10, just click on “New” button and add%JAVA_HOME%\bin
and click on “OK” button. - Lastly, go to command prompt and confirm:
java -version
echo %JAVA_HOME%
There are many examples of this such as shown on mkyong here.
Joe