java

 

  java :                                                                 compile :      javac filename.java

 1.JRE                                                                   run      :      java filename     

  2.JDK

          
What is the difference between JRE and JDK ? 


JRE and JDK

JRE 
(Java Runtime environment)
JDK
(Java Development Toolkit)
It is an implementation of the Java Virtual Machine* which actually executes Java programs. It is a bundle of software that you can use to develop Java based applications.
Java Run Time Environment is a plug-in needed for running java programs. Java Development Kit is needed for developing java applications.
JRE is smaller than JDK so it needs less Disk space. JDK needs more Disk space as it contains JRE along with various development tools.
JRE can be downloaded/supported freely from
java.com
JDK can be downloaded/supported freely from
java.sun.com
It includes JVM , Core libraries and other additional components to run applications and applets written in Java. It includes JRE, set of API classes, Java compiler, Webstart and additional files needed to write Java applets and applications.

 

HOW TO INSTALL JDK :

         1.Download JDK from sun.java

         2.click it to install and then click next up to finish the install

         3. go to the installed path and copy the installed path  

          for example

                   C:\Program Files\Java\jdk1.6.0_12\bin             and then copy it

          4. go to desktop, right click  mycomputer icon in the system properties window

          5 . click Advance tab

          6. there click Environment variables  

          7.  there  you will see user variables for Administrator and System variables

         8. In the user variables  

                       click new  

                          a window will open  

                            there give variable name   :  JAVA_HOME

                                              variable value   :  C:\Program Files\Java\jdk1.6.0_12\bin;

 

                        note:  (after the bin semicolon (;) is important )  

                 and in system variables

                                 select path and

                                              click edit  

                                                in the variable value : already some value will be there don't delete the pervious path .

beside that  path put simicolon and paste the installed  path

   forexample                                                 

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;g:\Program Files\Microsoft SQL Server\100\Tools\Binn\;g:\Program Files\Microsoft SQL Server\100\DTS\Binn\;G:\Program Files\Java\jdk1.6.0_12\bin  

     then click ok and apply  

              now go to start menu and  run  cmd

                     restart u r cmd 

 

 

 AONOTHER METHOD TO SET JDK PATH  

                  C:\a>set path=c:\programfiles\java\java.5.0_11\bin  

                   c:\a>echo %path% c:\program files\java\java.5.0_11\bin  

 

    below are the vedios