How to Create, Compile and Run your program



How create your program

     To create your program you can use any text editor like notepad

How to save your program

Class hello
{

public static void main(String args[])

{
System.out.println(“Hello”);

}
}

Consider above program

Save this program in C\mywork   folder by its class name

ie. Our above program class name is “hello” save the file as hello.java in notepad



How to set path

1.click on the start button on dextop

2.In Run type cmd and then click on ok

3.Then you see the black window

4.Type cd\mywork

5.Then you see  C:\mywork>



6.Type
C:\mywork>set path=”C:\”

7.Then type p and press tab until you get Program Files

C:\mywork>set path=”C:\ Program Files\”

Give back slash “\”

8.Then type j and press Tab you get java

C:\mywork>set path=”C:\ Program Files\Java”

Give back slash “\”

9.Then type j and press Tab you get jdk1.6.0

Give back slash “\”and again press Tab
Then u get


C:\mywork>set path=”C:\ Program Files\Java\jdk1.0.6\bin”

After this press enter


How to compile  your program


After above procedure

C:\mywork>javac hello.java

hello is your class name

if there is no error in program you again see

C:\mywork>


How to Run  your program

After above procedure

Type

C:\mywork>java  hello(its your class name)
















No comments:

Post a Comment