Java Installation

To install Java follow below steps:

  1. Identify your system architecture.
  2. Download & install JDK (Java Development Kit).
  3. Set path (JDK's bin directory).

Identify System Architecture

Your System architecture will be either 32-bit or 64-bit. x64 represents 64-bit OS and x86 represents 32-bit OS. You can check it as below:

  • Windows users: right-click on my computer then go to properties there you will find system type.
  • linux/unix users: run "arch" command (without quotes).

Download & Install JDK

  • Download "Java SE Development kit" from here
  • Go to above link then accept license agreement and then select to download suitable version based on your operating system and it's architecture(32bit/64bit).
  • Once the file is downloaded, install it

Set Path for Windows

Follow below steps to set path in windows.

  1. Right-click on "my computer" then click on properties.
  2. From left navigation click on "Advanced System Settings".
  3. Now go to advanced tab, there click on "environment variables"
  4. Check if variable named "Path" or "PATH" is already present, if yes then append your JDK's bin directory path. For example if current value of Path variable is "C:\windows\system32" then append like following C:\windows\system32;C:\Program Files\Java\jdk1.8.0_121\bin;(change as per path in your system).
  5. And if variable named Path is not present then create new variable give name "Path"(without quotes) and value C:\Program Files\Java\jdk1.8.0_121\bin(change as per path in your system).

Set Path for Linux/Unix

  1. Open .profile file present in your home directory or if not present then create new file named ".profile" and open.
  2. Now copy and paste following line export PATH=$PATH:/home/jdk1.8.0_121/bin/ (change path according to your java installation path) and save the file.

How to check whether the path is correctly set or not?

  1. Open command prompt.
  2. Run command "javac" , if the command is recognized then it's ok, otherwise check your path setting.
  3. check the same by running command "java".