exampracticeonline.com
Java Environments

Local Environment Setup

Java is freely available on Oracle's Website. Download the latest version of JDK (Java Development Kit) on your machine according to your machine configuration. Install JDK on your machine.

After you've installed Java in Windows, you must set the JAVA_HOME  environment variable to point to the Java installation directory.

We need to set two type of path.

Path Variable

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folder so we need to set path upto bin folders.
 

Class Variable

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we need to set classpath upto lib/rt.jar.

Setting Up the Path for Windows

To set java path in windows there are two ways to set java path:

  1. Temporary (by Command Prompt)
  2. Permanent (by Environment Variable)

Temporary (by Command Prompt)

Follow below steps:


1. Open Command prompt(cmd)

4

 


2. Write "Javac" on cmd

If java is not installed or path not set, then you will see below message:

4


3. Write relative path of your Java on cmd : "C:\Program Files\Java\jdk1.7.0_80\bin" 


4. Press Enter.


5. Then write on cmd: "Javac"- If you see below message that means your Java path set.

4

Permanent (by Environment Variable)

Follow below steps to set permanent path:


Step 1: Right click on my computer and select properties.

4


Step 2: Go to the Advance System Settings tab.

4


Step 3: Click on Environment Variables button.

4 


Step 4: Now alter the path variable so that it also contains the path to JDK installed directory.

4


Java path has been set to load to all tools javap, javah, jar, javac, java, appletviewer etc