Search This Blog

If you have any problem or question please write in the comments. We will try to solve and send you the solution. Not just that we will also post your problems solution on our blog.

Tuesday, 14 June 2011

How can you compile and execute your java program

After you have installed java open your command prompt or simply click at start button and then click run.
A small window will be opened. Write cmd in the text/search box and press run button.

Once you have opened command prompt open the drive/partition in which you have saved your program.
For example i have save my program in "local disk d/my progs". Write "d:" in command prompt and press enter.

After this write the folder name (as in above paragraph d/my progs) and press enter. I will write it as "my progs" and then enter. Now, write your program name and press enter. Just like this:


there "javac" is the command to compile your program and "" shows that the programs name is salary and it is a java file.

Finally your program is compiled and ready to execute. When your program will be compiled successfully a class file of the program will be created in the same folder as in your program. To execute your program just write the following command

java salary

and your program will be executed.

        "salary" is the program name. You should write the name of your program.

No comments:

Post a Comment