Java – Environment Set up

To execute Java programs, you need JRE – Java Run time Environment. But to write and compile java source code, you will need JDK – Java development kit. When you install JDK, JRE is automatically installed.

How to set up Java in Windows

  1. Download the JDK from Oracle download page. Depending on your system, you will download 32 bit or 64 bit exe file.
  2. Once the exe file is downloaded, just double click on that file and follow on-screen instructions to install JDK.
  3. Then You will have to configure some important Java environment variables as mentioned below.

Configuring the Java Environment Variables – There are several Java Environment variables that you must configure as mentioned below. Just open Environment variables window and add these variables.

  1. JAVA_HOME : C:\Program Files\Java\jdk1.7.0_79
  2. JDK_HOME : %JAVA_HOME%
  3. JRE_HOME : %JAVA_HOME%\jre
  4. CLASSPATH : .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib You can also give the path of other directories where java class files exists.
  5. PATH :  Just append %JAVA_HOME%\bin to the value of PATH Variable. Be careful. DO NOT overwrite this variable’s value. Otherwise your system might not work properly.

Below images will guide you through Java Environment Variables configuration process in Windows.

Step 1 – Open Advanced System Settings from Control Panel

Advanced System Settings

Step 2 – Click on Environment Variables Button

Environment Variable Button

Step 3 – Add Java Environment Variables as shown in below image.

Java Environment Variables

You may also like...