Pages

Saturday, February 17, 2018

Java environment variables JAVA_HOME and PATH setup on windows 7

In this post, we will learn to setup java environment variable JAVA_HOME and PATH on windows 7 operating system. 
To learn Java environment setup on windows 10 then click here.

Java environment setup

Step 1)  Download and install java

Download and install appropriate Java SE Development Kit as per your windows operating system.
link: http://www.oracle.com/technetwork/java/javase/downloads/


Step 2) Setting JAVA_HOME and PATH

To compile and execute, java program needs the java environment i.e. java installation path.
You can specify java installation path by setting two properties JAVA_HOME and PATH.
There are two ways you can set properties :
  •  Command prompt 
    • Click "Start" to search "cmd" and open command prompt.
    • Set Java_Home and Path as follows :
                        c:\> setx JAVA_HOME "{java_installation_path}"
                        c:\> setx PATH "%PATH%;%JAVA_HOME%\bin"


  • Then check java version using the following command :
                        c:\> java -version

                      Example :



setting java_home
Command Prompt
  •  GUI
    • Click "Start" then right click on "Computer" >> "Properties" to open system control panel.


    Properties


    • Click on "Advance system settings" to open "System Properties tab" 


System Control Panel

    • Go to "Advanced" tab on System Properties and click  "Environment Variables".


System Properties
    • Click on "New". 


Environment Variables

    • Variable Name : JAVA_HOME and                                             Variable value :{java_installation_path} and then click OK.

Add New User Variable


      • To set path, click existing variable "Path" >> click edit >> add java path at the end and click OK.


      Add java path

        • Then check java version using the following command :
        •                         c:\> java -version
           
        Java Version Check

      After following above steps you will be able to setup java environment variables java_home, path and you can start writing and executing the java program.




      2 comments:

      1. The Java Programming Language A Detail Introduction in Bullet Points

        ReplyDelete
      2. Have a great career experience along with the Azure Training in Chennai from Infycle Technologies, the best software training institute in Chennai. Along with that, get up with other technical courses like Data Science Training, Selenium training, Cyber Security training, Big Data training with an outstanding training experience. For best offers, reach us on +91-7504633633, +91-7502633633.

        ReplyDelete