Follow the Following steps
Step 1.
First of all you should need to download JDK (Java Development Kit) so go to
Official Site of Oracle and choose a version of JDK and downlod it, you can directly download latest version of JDK from here to Download
Click Here
Step 2.
After download JDK install it by double click on .exe file and flow instruction and you can also install it by right click on exe file and choose "run as Administrator"
Step 3.
After successfully installing your JDK (Java Development Kit) Go to C > Program Files and look for folder name "Java" and open folder then open jdk1.8.0 folder then open "bin" folder and copy the path of folders : It may be look like as "C:\Program Files \Java\jdk1.7.0_45\bin"
If you not found "java" folder in "Program Files" then see these steps
open C drive then open Program Files (x86) then open Java folder then open jdk1.8.0 then open "bin" folder and copy the path
It should be look like as "C:\Program Files (x86)\Java\jdk1.8.0_45\bin"
Step 4.
after copy path roght click on Computer choose properties then click on "Advance system settings" then choose "Environment variables" then click on "New" then type any name in variable name and paste the path of folder that was we are coped then click on "OK" > "OK" button it click on two time on ok button
Now we have successful JVM (Java Vertual Machine) have created to test it see as Step5
Step 5.
open "Command Prompt" and Type "java -version" and heat the enter button then you can see your version of JDK
Step 6.
Now to run your first java program follow these steps
1.create a java program such as
public class Hello
{
public static void main(String []args)
{
System.out.println("hello world");
}
}
2. save it as Hello.java it necessary to save your program file as similar to your class name of program as in my case i save it on my desktop such as "Hello.java"
3.now open your command prompt and find path, as in my case it is "cd desktop" because i save my file on desktop and then type "javac Hello.hava" and heat enter button to compile your java program
4.then type "java Hello" to run your program your program will show you output