hello friends ,
I am here to explain how to run a java program on your system. It is very simple .
write a java program and save it with ".java" extension.
for example :
class A
{
public static void main(String[] args)
{
System.out.println("Hello World !!");
}
}
Your JDK ( Java Development Kit ) version may differ from mine but it does not matter so much for beginners .If you don't have installed JDK on your machine yet you can download latest JDK from this official link of Oracle "download latest JDK Version " and install it at default directory , after installation a java directory will be created in C drive under program files.
Now you can save above given program as "A.java" . beginners can simply save the program at location "C:\Program files\Java\jdk1.7.0_51\bin".
Now goto command prompt and reach to the location where file is saved . for reaching you can simply type "cd C:\Program files\Java\jdk1.7.0_51\bin" as :
now press enter.
and type the command "javac A.java" and press enter for compilation and then type command "java A" for running the program.
Output window will appear like this ::
Thank You :)
I am here to explain how to run a java program on your system. It is very simple .
write a java program and save it with ".java" extension.
for example :
class A
{
public static void main(String[] args)
{
System.out.println("Hello World !!");
}
}
Your JDK ( Java Development Kit ) version may differ from mine but it does not matter so much for beginners .If you don't have installed JDK on your machine yet you can download latest JDK from this official link of Oracle "download latest JDK Version " and install it at default directory , after installation a java directory will be created in C drive under program files.
Now you can save above given program as "A.java" . beginners can simply save the program at location "C:\Program files\Java\jdk1.7.0_51\bin".
Now goto command prompt and reach to the location where file is saved . for reaching you can simply type "cd C:\Program files\Java\jdk1.7.0_51\bin" as :
now press enter.
and type the command "javac A.java" and press enter for compilation and then type command "java A" for running the program.
Output window will appear like this ::
Thank You :)

