Setup – JDK – Java Development Kit

By ongraph
November 20, 2013 | 1086 Views

Latest Industry insights to keep you updated on the latest happenings.

JDK – Java Development Kit : To install JDK on your system you need to download from it's
          official site, Java SE is freely available from the link Download Java. You can download a version
          based on your operating system.
 

          Once you have download required file execute .exe file to install and set environment variable
          to point correct installation directory.

          To set up environment variable we assuming that your installation directory is C:\jdk1.6

          1.1 Setup Path for Windows/XP

                  Step-1 : Go to your Computer Icon at desktop and right click on it will open a box than click
                               on properties menu to open system window

                  Step -2 : Now click on Advanced system setting link appear at the left side of system window
                                will open system properties window.

                  Step-3 : On system properties window select Advanced tab and click on environment variable
                               button appear at the right bottom of tab will open environment window.

                  Step-4 :  In environment window there will be a system variable section contain details of existing
                                existing system variables.Now click on new button appear below system variable
                                section and set variable name to JAVA_HOME and variable value to path of your
                                installation directory in my case it is C:\jdk1.6. and click on ok button.

                  Step-5 :  Now select “path” system variable from system variable section and click on edit
                                button and add  ;%JAVA_HOME%\bin; at the end of existing value
                
                                Suppose in my case existing value for path is like  –

                                       %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

                                After adding java path value it will be like –

                                       %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32
                                \Wbem;%JAVA_HOME%\bin;

          1.2 Setup Path for 95/98/ME   
                 
                   Step-1 : Open and edit  'C:\autoexec.bat' file and add the following line at the end of file:
                                'SET PATH=%PATH%;C:\jdk1.6\bin' 

          1.3 Setup Path for Linux/Unix and Others.

                   There are multiple choices to setup environment variable.

                   Step-1 :  If you want to setup just for current session than just type below command in
                                command prompt.                               

                $ export PATH="${PATH}:/usr/jdk1.6/bin"           

                   Step-2 : If You do not always want to define an environment variable globally. For instance, you
                                might want to add /usr/jdk1.6/bin to the PATH variable but do not want all other
                                users on your system to have that in their PATH too. The following files should be
                                used for local environment variables on your system: ~/.bashrc, ~/.profile,  
                ~/.bash_login and ~/.bash_logout.To add a directory to PATH for local
                                usage, put following in ~/.bashrc:

                PATH="${PATH}:/usr/jdk1.6/bin" 

                                To update the variable, re-login or source the file: $ source ~/.bashrc.

                    Step-3 : If you donot have .bashrc or other file on your operating system then you can also
                                setup environment variable in /etc/profile file using one of these two steps:-

                                1. Login as root user and run following command:

                                    echo “export JAVA_HOME=/usr/jdk1.6/bin;” >> /etc/profile

                                2. By edit /etc/profile using vi /etc/profile command and add following line at the end of
                                    /etc/profile content

                                    export JAVA_HOME=/usr/jdk1.6/bin;  To save hit Esc + : +  wq
 

Monthly industry insights to keep you updated on latest happenings

Follow us on Twitter
Follow us on Facebook
Follow us on Linkedin