In this post I am going to explain how to install Java 1.8 on your machine and verify the same.
Here’s the steps:-
Install Java 1.8
You can install Java1.8 from Oracle website.Here’s the link:-
You will see there are two executable files for windows, one for 64 bit and another for 86 bit.Check you System specification by going to Control Panel -> System and Security ->System.
You need to download the executable file and run it on your local machine.By default the java package will be installed under C -> Program Files->Java. But you can change the path as per your specifications.
After your java package is installed you will get the following screen:-
Set Environment Variables
You need the specify the path to the java folder using the PATH variable under Environment variables of your machine. You can access the environment variables of your machine by right click on My Computer or This PC ->Properties
Set the Variables
JAVA_HOME :- C:\Program Files\Java\jdk1.8.0_221
Add the following in the path variable:-
Verify Java Installation
Check if Java is correctly installed on your machine.Go to command prompt/terminal and type the following command:-
If in the command prompt its shows that the java is not recognized as a command, revisit the variable and their paths.You will get this error when the user variable and environment variable paths do not point to the correct location of java folder.
Another reason might be that the Java package is not installed properly ,check your bin folder and jre folder.If required reinstall the java package and following the above steps again