Showing posts with label Java Installation. Show all posts
Showing posts with label Java Installation. Show all posts

Friday, 4 January 2013

Changing the PATH Environment Variable

Setting up PATH for Java Program


We may have to set the PATH for environment variables for the easier execution of the Java Program. 


We can run the JDK without setting the Environment variable. However, it is easy to compile and run the codes written in java after setting the PATH. If you do not set the PATH variable, you need to specify the full path to the executable file every time you run it. 

Eg: C:\> "C:\Program Files\Java\jdk1.7.0\bin\javac" MyProgram.java

To set the PATH variable permanently, add the full path of the jdk1.7.0\bin directory to the PATH variable. Typically, this full path looks something like C:\Program Files\Java\jdk1.7.0\bin. Set the PATH variable as follows on Microsoft Windows:

  1. Click Start, then Control Panel, then System.
  2. Select Advanced, then Environment Variables.
  3. Add the location of the bin folder of the JDK installation for the PATH variable in System Variables. The following is a typical value for the PATH variable:
C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.7.0\bin

Notes: You can add multiple directories separated with semicolons(;).
      PATH Environment variables are Not Case Sensitive. 

Installing Java

How to Install Java on a Windows Computer


The following instructions show how to install Java jdk to run your first Java Program


  1. Click here to open a page where you can download Java directly from Oracle. 
  2. Find the latest version, by the time I write this, the latest available on the page is "Java SE7u10". 
  3. Click on the download tab and save a known location in your Computer. 
  4. Make sure that that its byte size provided on the download page. After the download has completed, verify that you have downloaded the full, uncorrupted software file.
  5. Double Click the downloaded file to start the installer. 
  6. Follow the instructions on the Installer Wizard to complete the installation. 
Note: The JDK installer will automatically set path for the environmental variable. No need to worry about the path as of now.