How we create First "Hello World " Program in Java:-




1)  Check Java Environment

Java software is installed in the machine or not, In the windows machine, we can check under c:/program files/java folder it should contain JDK and JRE both.


JDK means Java Development Kit, It provides program compilation means convert java program code to byte code.

JRE means Java Runtime Environment, It is used to Execute Java Byte Code to machine code using JVM (Java Virtual Machine), JIT (Just-in-time) Interpreter exist under JVM which is used to execute byte code result.

If the Java environment is not set then install JAVA using JDK and JRE.



2)    Check the Java Environment path that it is set or not.
       

     Open the command prompt and type javac, if javac will be described then the path is set otherwise path is not set if javac not recognized internal or external command ...


How we set java path:-

Right click on mycomputer----> propeties  ---> Advance System setting ----> Environment Variable-----> New ---> 

variable name:-   path

variable value:-  C:\Program Files\Java\jdk1.8.0_121\bin

press ok, ok and ok, restart command prompt.


3)  now open notepad and write a java program


class Hello
{
   public static void main(String args[])
   {
       System.out.println("hello world");

   }

}


4)  Save this program d:/java5  or anywhere

5)   Open command prompt and type location (d: to switch d drive, cd to change directory)

6)   javac FileName   (   javac Hello.java)


7)   java ClassFileName  (java Hello)




   


next blog blogger.com/blog/post/edit/7768209714160124788/695808935430204723

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post