Wednesday, 22 May 2013

Setting up java in windows

         

Checking whether you have installed java or not 

  and 

 configuring java in Windows 7/ XP/Vista


First check you have installed java or not

  •    Go to control panel and check whether you have installed java or not
  •    If found java then follow next step else directly go to step 1 to install java (below)
                       
To check whether java has been configured properly or not try these

  •     Go to command line and type command      

                                                   javac

  •     If you get command not found then java is  not configured properly

  •     If you have installed and configured properly  then you should get something lyk shown below  
              which means you can skip this post since you have java and check my other posts here


            C:\>javac
                  Usage: javac <options> <source files>
                  Where possible options include:
                  -g:                                         Generate all debugging info
                  -g:none                                 Generate no debugging info
                  -g:{lines,vars,source}            Generate only some debugging info
                  -nowarn                                 Generate no warnings
                  -verbose                               Output messages about what the compiler is doing
                  -deprecation                         Output source locations where deprecated APIs
                  (continues)


  •    If you  don't have java in your system then follow from step 1 and If you have java installed (saw in control panel)     but got command not found in command line when you typed javac then follow from step 5 to configure properly



To Install java


1. To know which bit your OS is - Right click on mycomputer -> properties -> See for System type

     If you have java installed already you can skip next 2 steps

2. Download java from here.

3. Select Windows offline 32bit or 64bit according to 1 step

4. Open the installer and install it

5. To configure: Right click on Mycomputer -> select properties -> Advanced System Settings ->  
    Environmental variables -> Under user variable add these 3 variable name and values one at a time

  • click new give these values
                    variable name: PATH
                    variable values : C:\Program Files\Java\jdk1.7.0_07\bin;.;
                    click ok

  • 2nd
                    variable name: JAVA_HOME
                    variable values : C:\Program Files\Java\jdk1.7.0_07
                    click ok
  • 3rd
                    variable name: CLASS
                    variable values : C:\Program Files\Java\jdk1.7.0_07\lib;.;
                    click ok

note:- browse to your java installed location and paste that path

These steps should have configured you java correctly

Now try javac command in command line it should work from any directory :)

Please do post, any comments you have or any doubts about steps you got stuck up with ...

Check my other posts here


Leave your doubts or suggestions in comments section..

No comments:

Post a Comment