Setting Up The Environment Variables for Windows

If you are new to Java Programming or writing Java program for first time, then you  need do some setup for Java JDK. The steps for them are given below:

  1. Install the Java Development Kit (JDK) if you don't have installed earlier. To download it click here and install it.
  2. Setting up the environment variables for Windows 7. 
    • Right click on "Computer" and select "Properties" option as shown in Fig 1.
    • After that you will see the window shown in Fig 2. Click on "Advanced system settings" option then click on "Environment Variables" button and finally search for "Path" system variable and click on "Edit" button as shown in Fig 2.
    • Now go to the directory where you have installed Java JDK here "C:\Program Files\Java\jdk1.8.0_60\bin" and copy this path and add this in system variables as shown in Fig 3 and Fig 4.  Please do not delete any text from Variable value just insert semicolon (;) at last and paste the path that you have copied.
    • Then click OK three times. That's it. Now you can run Java programs from anywhere.
  3. To check whether the environment variables are set properly open "Command Prompt" and type "javac"  and press ENTER. You will display the output as shown in Fig 5.
    Fig 1

                                                                                                                 Fig 2
      Fig 3
      Fig 4

      Fig 5


      Popular posts from this blog

      Program to define a class 'employee' with data members as empid, name and salary. Accept data for 5 objects using Array of objects and print it.

      Program to input age from user and throw user-defined exception if entered age is negative

      Define a class Student with four data members such as name, roll no.,sub1, and sub2. Define appropriate methods to initialize and display the values of data members. Also calculate total marks and percentage scored by student.