Page Nav

HIDE

Grid

GRID_STYLE

Pages

latest

How to Run Java application program

Implementation of a Java application program involves a following step. They include: 1. Creating the program 2. Compiling the program 3. Ru...

Implementation of a Java application program involves a following step. They include:
1. Creating the program
2. Compiling the program
3. Running the program

Remember that, before we begin creating the program, the Java Development Kit (JDK) must be properly installed on our system and also path will be set.

  • Creating Program

We can create a program using Text Editor (Notepad) or IDE (NetBeans)


          class TestJava
          {
                     public static void main(String []args)
                     {
                                   System.out.println(“My First Test Java Program.”);
                     }
          };

File -> Save -> d:\TestJava.java
 

  • Compiling the program

To compile the program, we must run the Java compiler (javac), with the name of the source file on “command prompt” like as follows

 If everything is OK, the “javac” compiler creates a file called “TestJava.class” containing byte code of the program.

  • Running the program

We need to use the Java Interpreter to run a program.