Tuesday, July 15, 2014

Run Java Program On Computer

Now I am going to show you how to run a java program on your computer.It is by command promote on your computer.You can run any kind of java program by program editor or any software or something like that.Here I want to show you "How to run a java program without a program editor or software".So,remain with me and follow my instructions.

I'm not going to tell you about the syntax of the java program.I want to show simply run java program with cmd.

1.At first you have to open a text editor like notepad or notepad++.So,open that.
2.Click file>save as and save that file in C drive in the folder any name such as test named youtube.java or anything else.It must be with .(dot) java extension file.Because it is important for java program.
3.Now write a simple hello world java program like it.

4.
class apples{
public static void main(String args[]){
System.out.println("hello world");
}
}
Here in this program what happened that I will show you later.I want to show you just "How to run a java program without a program editor or software".

5.Then save it(cntr+S).
6.After that open cmd and write the instructions below and press enter.
cd \ >dir > cd test >dir > javac youtube.java > dir > java.apples.

7.Write one by one and press enter.Then you can see the last output "Hello world" or "my name is khan"

Here is some screenshots for your help.
                                                                     
Screenshots

Step one

Step two


Step three


Step four


Step five


Step six


Step seven


Step eight



So in this way you can run a java program with cmd.So,if the instructions are helpful to you then please comment and subscribe.

No comments: