Pages

Monday, February 6, 2012

1st Java Program


class Hello{
               public static void main(String[] args){
               System.out.println("Hello,Welcome to JAVA ");
     }
}




Save this file as a  " Hello.java "  
To Compile  :- Go to command prompt and type javac Hello.java and press enter ..

To Rum        :- Again type java Hello 
we'r using save name (Hello.java  for compile and class name (Hello) for run the program.

How to Install JAVA & How to Set Class Path



This video will helps you to install JDK to your computer and how to set class path... 

SET CLASS PATH 


  • First go to Program Files --> Java Folder
  • Then go to jdk1.6.0 (any version)
  • After go inside of Bin folder 
  • There is a appletviewer.exe .Then right click on that and get the Properties.
  • GO to General tab and copy the path of Location .   ex:- C:\Program Files\Java\jdk1.6.0\bin 
  
  1. First go to Star menu --> Computer
  2. Then Right Click and go to Properties --> Advance Systems Settings 
  3. Then there is a Advance tab go to that tab
  4. Click Environment Variable Button ..
  5. There is a Button call New in User Variables.
  6. Click that button and give the path as a Variable Name
  7. And past above path of location as a Variable Value.