Java Installation: Downloading, Installing and Setting Path

In this tutorial we will learn how to download and install
Java and then setting path to make Java programs run.

Downloading and Installing

JDK Download
  • Select Accept License
    Agreement
    and then download appropriate version for your operating system.
JDK Versions
  • After downloading, install the JDK.
  • If installation is done properly you can see two files java and javac by going to C:Program FilesJavajdk1.7.0_60bin.

 

How to set Java path?

To make java programs compile and run you have to set the
path of java compiler. You can set java path in two ways: temporary and
permanent.

Temporary Java path setting

  • Copy the path of bin folder by going to jdk/bin i.e. C:Program
    FilesJavajdk1.7.0_60bin
    . Here jdk1.7.0_60 (will vary according to jdk version).
bin path
  • Open command prompt and write set path=C:Program FilesJavajdk1.7.0_60bin and then press enter.
set temporary path
  • This method will work only one time. After closing cmd you
    have to repeat the same process again.

Permanent Java path setting

  • Right click on Computer
    and then select Properties.
  • Then goto Advanced
    tab and click on Environment Variables.
  • Now click on new
    and then in variable name field write path and
    in value field write the path of bin folder i.e. C:Program FilesJavajdk1.7.0_60bin
 
set permanent path
  • Click ok to save settings. You have done!
  • This will permanently set the path and you can run programs
    whenever you want.

Check path setting was properly or not

  • You can confirm whether the path setting was properly or
    not. Just open cmd again, write javac
    and press enter.
Check path setting was properly or not
  • If it will show details about the java compiler then it is ok.
  • If it will show and
    error like ‘javac’ is not recognized as
    an internal or external command
    then you have done something wrong. Check
    the whole process again.
In the next tutorial we will discuss about how to compile and run java programs.

1 thought on “Java Installation: Downloading, Installing and Setting Path”

Leave a Comment

Your email address will not be published. Required fields are marked *