Wednesday 9 September 2015

Installation of java & Set environment variables for java installation

We can divide this post in 3 parts:-
  • Java Installation
  • Setting up environment variables for java installation
  • Verify Java installation and newly set up environment variables are proper.


Java Installation:-

  1. Go to Java download page.
  2. Check whether your PC is 32 bit or 64 bit.  I’m running 64-bit version of windows 7.
  3. Click on Accept License Agreement radio button after reading License agreement.
Java Download page
Java Download page
4. For 32 bit Operating System [OS], click on jdk-8u77-windows-i586.exe and for 64 bit Operating System [OS], click on jdk-8u77-windows-x64.exe


5. Your download will start after clicking on link
download starts.png
Java downloading on local machine

6. I have already downloaded JDK [Java Development Kit] version - jdk-8u77.
.
JDK installable.png
Java Installable
7.   Now double click on your java installable. Follow with images below:-
JDK Installation step 1
JDK Installation step 1


JDK Installation step 2
JDK Installation step 2

            Please note the highlighted path, we would be using this path to set a environment variable.
          
JDK Installation step 3
JDK Installation step 3


JDK Installation step 4
JDK Installation step 4
                    JRE is getting installed.


JDK Installation step 5
JDK Installation step 5


JDK Installation step 6
JDK Installation step 6
Please note that - Both JRE & JDK got installed using same installable.
.


Setting up environment variables for java installation-

 We would be setting below two environment variables -
  • JAVA_HOME : C:\Program Files\Java\jdk1.8.0_25
  • PATH      : ;%JAVA_HOME%\bin;
Follow along the images to set environment variables.
1. Press Windows Key from Keyboard Windows key iocn
                          OR
               Click on Start icon
start icon
windows start icon
                                  


Way to set up environment variable
Way to set up environment variable 
2.  Right click on Computer.
3. Click on Properties
Way to set up environment variable
Way to set up environment variable
Way to set up environment variable
Way to set up environment variable
You can also open above window directly using [rundll32.exe sysdm.cpl,EditEnvironmentVariables] .

  • Open Run Prompt [Win key +R]
  • Type rundll32.exe sysdm.cpl,EditEnvironmentVariables
  • Hit Enter key


Way to set up environment variable
Way to set up environment variable 
Setting up JAVA_HOME
Setting up JAVA_HOME


Entry of JAVA_HOME
Entry of JAVA_HOME


Updating Path Variable
Updating Path Variable


Updating Path Variable
Updating Path Variable

There is a blogpost explaining the rationale behind all these environment variables.


Verify Java installation and newly set up environment variables are proper.



Open Command prompt [Press Win key + R]
Type cmd and hit enter.
Run Prompt
Run Prompt
Command Prompt will be open


Command Prompt
Command Prompt


Type java -version and hit enter.
Command prompt should display newly installed java version.
Verify Java Version in command prompt
Verify Java Version in command prompt




0 comments:

Post a Comment

Copyrights held by Amol Chavan. Powered by Blogger.