Jump to content

Java Steps to create a program with Eclipse


Frank

Recommended Posts

Eclipse is a professional IDE, which at first may seem complex development of our first programs.

All Eclipse program requires the creation of a "project", for this we must select from the menu of options:

foto011.jpg

Or from the toolbar of the Eclipse:

foto012.jpg

Now, the dialogue where we define our project name appears:

foto013.jpg

In the text field "Project Name" we enter as name: Project1 and leave all other options dialogue with the defaults. Click the "Finish" button.

Now in the window "Package" the project we've just created appears:

foto014.jpg

As a second step we will see that every Java program requires at least one class. To create a class we select from the menu of options:

foto015.jpg

Or from the toolbar of the Eclipse:

foto016.jpg

In the dialog that appears we must define the class name (in our first example we will call the class as Class1, then see that it is important to define a name that represents the goal of it), the other data of the dialogue we left with the default values:

foto017.jpg

After pressing the "Finish" button we have the file where we can code our first program:

foto018.jpg

Later we will see the files created in a project, now devote ourselves to encode our first program. In the editing window already we have the skeleton of a Java class that the Eclipse environment we created automatically.

public class Class1 {

}

All Java program should define the main function. This function must encode in the class, "Class1".

We proceed to type the following:

public class Class1 {

    public static void main(String[] parameter) {

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

    }

}

That is we have encoded in the Eclipse IDE our first program:

foto019.jpg

As a last step we have to compile and run the program, this can be done from the menu of options:

foto020.jpg

Or from the toolbar of the Eclipse:

foto021.jpg

Unless there are coding errors, we'll see the result of running in a window of Eclipse called "Console" that appears at the bottom:

foto022.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...