In previous article we saw What is Java? Where and Why to use Java? And features of Java programming language. In this particular article we will see how to setup Java environment in local machine.


Install Java and Environment Setup on Windows

To start coding in Java one has to install JDK(Java Development Kit for Windows) and setup environment. To Install Java and environment setup on Windows machines follow the steps listed below:

1) Download appropriate JDK(32-bit or 64-bit) from Oracle?s Official Site, Download Java.

2) It?s a simple executable file, double click on it and follow the instruction. It?s a simple wizard just like any other windows application install.

3) Once installed you have to set the installation directory path, so that the sytem can know about java installation.

4) Go through the java installation directory it should look like ?C:\Program Files\Java\jdk1.7.0_71\bin?. Please make sure you have to copy path through ?bin? that too of jdk nor jre.

5) Done, now go to your command line and type following:

C:\Program Files\Java\jdk1.7.0_71\bin

If everythong went right, you will see something like this on screen:

java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


6) Done. That?s is you are done with Java installation on your windows machine.


Install Java and Environment Setup on (Linux & Unix)

Based on your version of Linux machine and preferences,there are many ways to install and setup java on linux. Here are 2 major techiniques listed, Installation can be performed using either of the followin :

(A) Install Java on 32-bit/64-bit Linux Platforms using tar.gz zipped file

1) Download the appropriate tar.gz(32-bit or 64-bit) file from Oracle?s official site, , Download Java.

2) Change directory to the location where you would like the JDK to be installed, then move the downloaded .tar.gz archive file to the current directory.

3) Unpack the tar.gz file using following command: tar zxvf jdk-8uversion-linux-x64.tar.gz.

4) The Java Development Kit files are extracted and installed in a directory called jdk1.8.0_version in the current directory.

5) Done, you are donw with installing Java on Linux 32/64 bit machine.


(B) Install Java on 32-bit/64-bit Linux Platforms using rpm package

This techniques installs a java development kit and related file on a linux environment with the help of a .rpm extention file. This method is prefered basically on RedHat and Fedora like OS. The installer user must be a super user to install the package at root.

1) Download the appropriate .rpm(32-bit or 64-bit) package from Oracle?s official site, , Download Java.

2) Make sure you are acting as super user for the machine, arternatively you can move to super user by appling su and that password.

3) Before installing a fresh Java its better to remove and uninstall any other old installation from the sytem, apply following command to do so:

# rpm -e package_name


4) Now install newly downloaded .rpm package by appling folllowing command:

# rpm -ivh downloaded_rpm_package


5) Done, you are done with installing Java on Linux 32/64 bit machine.


Install Java and Environment Setup on MAC OS

1) Download the appropriate .dmg(32-bit or 64-bit) package from Oracle?s official site, , Download Java

2) Double click in the downloaded .dmg file a installation box will pop up, double click on icon to install app.

3) Next a introduction winow will open, simply press continue to go to next level.

4) Now a installation window will open, click on install .

5) If everything goes right a final window showing ?Installer is trying to install new software? will apeear.

6) You will need to enter your system username and password in the installation window, click install sofware.

7) Done, you are done with installing Java on MAC machine.




No matters what OS you are using, just install the appropriate JDK as explained above and you are up for start coding in Java.Please note that JRE is a part of JDK so it?s installed automatically along with JDK installation.

  • By Techburps.com
  • Feb 17, 2015
  • Core Java