Install Java

Bookmark
In this article let us learn about installing Java and how to get the development environment ready for Java programming.

To prepare the Java development environment, you need to do the following steps:

  1. Download Java
  2. Install Java
  3. Setup Path
  4. Test installation

1. Download Java

Download a JDK to write Java programs. There are different flavors of Java. Then you java JRE, JDK etc. Enough to confuse a beginner. To start with Java programming, you need to download Java SE.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

The above given link is the page that gives the latest Java SE for download. It is free. Generally in that download page you will see two options at the top. Java Platform (JDK) and NetBeans with JDK. NetBeans is an integrated development environment (IDE) for Java.

To learn Java, I recommend you to start with simple text editor like Notepad++. Windows notepad is too simple and so do not use that please. If you are a Linux based person, you can start with Vim. Download Notepad++ (its free) and install it. This is the editor using which we will write Java programs. 

Now coming back to Java download. Download the Java Platform JDK (without NetBeans). So we will be using the latest version of Java SE, means Java "Standard Edition".

2. Install Java

If you are on Windows, Java installation is a standard step by step (click next) process. It will present you different options and by default what ever is selected is good to go. Just click next, next and follow the steps, it is a simple and straightforward task to accomplish.

3. Setup Path

It is essential to have a global path defined in the OS environment. So that it will give us the luxury of compiling and executing a Java program from any path in the system. In Windows,

  1. Go to My computer and select properties, advanced system settings then in System Properties
  2. Go to 'Advanced' and click 'Environment Variables'

Add the PATH variable with value pointing to the install location of the JDK. Refer the image below:

Java Setup Path

4. Test Installation

To test if the installation is right, open a command prompt and type the command "javac -version". It should respond with the version of the JDK installed. Then you are ready to start writing Java programs.