How to run first Java program in Eclipse?

How to run first Java program in Eclipse?


Posted in : Core Java Posted on : May 28, 2015 at 12:56 PM Comments : [ 0 ]

This video tutorial teaches you to run your first Java Program in popular integrated development tool Eclipse.

Java Video Tutorial: How to run first Java program in Eclipse?

Eclipse development tool is an Java based Integrated Development Environment(IDE) for writing, compiling, debugging and running the Java based application. It also various types of projects including Web applications and Enterprise application. In this tutorial I will teach you to create and run your first Java program from Eclipse tool.

It is easy to run the Java code from Eclipse as compared to the process of running the Java program from command line. Eclipse provides the tool for highlighting the syntax error in Java program, which makes programming much easier. Eclipse also automatically compiles the source code of the project to ease the development of the application.

Software required:

  • You should have Java Development tool installed on your computer
  • JDK is configured properly
  • Eclipse IDE is already installed and running

Steps to run first Java program in Eclipse:

  1. Create a new project in Java
  2. Create package to store your Java classes
  3. Create Java class
  4. Write method to print the data on console
  5. Run the program by right clicking on the code window and then selecting run as Java Application

Following Video tutorial shows you how to create and run the first Java program in Eclipse IDE:

Source code of the first Java example

Here is the source code of the Java program we have used in this tutorial. This program is automatically generated by the Eclipse IDE while creating the Java class:

package com.devmanuals;

public class HelloWorld {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Hello World");
	}

}

For printing the message on console we have used the following line of code:

System.out.println("Hello World");

The above method prints the "Hello World" message on the console. The following code:

System.out.println("Hello World");

uses the System.out.println () method for printing message on console.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics