Docstoc

How to download java and

Document Sample
How to download java and Powered By Docstoc
					How to download java and
   how to set variable

 Prepared By:- Keval Nagaria
        How to download JDK
• JDK stands for Java Development Kit.
• To write any java program you will need to
  download JDK.
• You can download JDK from site-
• http://java.sun.com
• After downloading and running the setup
  move to next slide.
     Ways to set variables for java
•   There are 2 ways to set variable for java-
•   Using DOS prompt &
•   Using properties of my computer
•   I am telling you the second one Using
    properties of my computer.
  Right Click on My computer and go to
                properties




Double click


4.Double click on path
                  Cont…




• 5.in variable value: make ";" semi colon and
  paste the copied path and again do semi
  colon ";"
• 6.ok.
• 7.for conformation open cmd (command
  prompt) and type "javac"
Cont…
                  Cont…
• 8. Now your java successfully install ..
• 9. How to run.. So copy the following
  program in your notepad and save it
  same name as class name which
  contain main function..
       How To Run First Program
class p2
{
   public static void main(String args[])
   {
     int i,j;
     String ch;
     ch=args[0];
     if(ch.length() != 1)
        System.out.println("Enter Only 1 character as Command
   Line Argument...");
                                            Cont…
else
        {
            for(i=0;i<5;i++)
            {
               for(j=5-i;j>0;j--)
                  System.out.printf(" ");
               for(j=0;j<=i;j++)
               {
                  System.out.printf(" ");
                  System.out.printf(ch);
               }
               System.out.println();
            }
        }
    }
}
                   Cont…
• 10. open cmd and go path where you save
  program .
• 11. type javac progName.java (for compile the
  program) and then type java progName (for
  run that prog.)
Output of program

				
DOCUMENT INFO
Shared By:
Stats:
views:4
posted:8/25/2012
language:English
pages:13
Description: How to download java and how to set variable