First, Download java 8 from www.oracle.com/jdk8-downloads
Now, Set up environment variable if you want to run from CMD,
Later we will learn how to setup java 8 in eclipse
Setting the JDK path in windows >
- Go to My Computer, right click on properties
Click Advanced System setting, Environment Variable, New..
Then we will set environment variables
- JAVA_HOME &
- PATH >
1. set JAVA_HOME >
Variable name : JAVA_HOME
variable value: C:\Program Files\Java\jdk1.8.0_05 (Directory in which java 8 has been installed)
2. set PATH >
Again click on New..
Then enter -
Variable name : PATH
variable value: C:\Program Files\Java\jdk1.8.0_05\bin
Ensure environment variable is set properly >
Ensure version which you are running is java 8 -
Go to cmd >
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
Read more in detail >
Download and install JDK, Setting environment variables JAVA_HOME & JDK PATH temporarily and permanently in windows, What is a path? need to set PATH variable?
2) Setup java 8 in eclipse
click Windows, Preferences,
Go to Installed JREs (which is under Java > Installed JREs)
Then click Add..
Select Standard VM >
JRE home: C:\Program Files\Java\jdk1.8.0_05\
JRE name: jdk1.8.0_05
Finally you will see screen like this >
Where you can see jdk1.8.0_05 is checked, that means java 8 is configured in eclipse now.
Now, we will have both jdk and jre available. (As jre is part of jdk)
Read in detail : Differences between JDK, JRE