ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Computers & Software»
  • Computer Science & Programming

ECLIPSE IDE - A Walk Through Creating the "Hello World!" Tutorial Application

Updated on August 1, 2014

Prerequisites for the "Hello World!" JAVA Tutorial

You may have heard about ECLIPSE IDE and that is its a great tool for breaking into programming but know little else. There are a number of sources for obtaining information. I have written an article "Eclipse IDE (Integrated Development Environment) Tutorials - Extremely Useful for Java & Android Programming." which would be a quick read.

Essentially, you will need to have a version of the ECLIPSE IDE for JAVA downloaded and an appropriate version of JDK (the Java Development KIt). JDK download are available at the Oracle Corporation website and ECLIPSE downloads are available at the Eclipse Foundation website.

Once you have downloaded and successfully installed these products you are pretty much ready to go. I have another useful hub article "ECLIPSE IDE Tutorial - Looking at the ECLIPSE IDE Directory Structure" which will familiarize the components of the ECLIPSE release.

With that said, you should now be ready to start working on getting the "Hello World!" program built.



Step 1: Starting ECLIPSE

The first thing wyou will want to do is go to the directory where ECLIPSE is installed and click on the ECLIPSE program icon.

Invoke ECLIPSE from the Install Directory

eclipse is highlighted. double clicking will start the application.
eclipse is highlighted. double clicking will start the application.

Step 2: Reply to "Run" and Select Workspace

A screen will appear asking you if you wish to run the application. .Click on run. The next screen which appears will ask you to specify a workspace. This location is where Eclipse will create your source files. If it is acceptable, click on OK.

The first time you run ECLIPSE, or if you indicate a new workspace, the welcome screen will appear.

The following two illustrations show the workspace selection screen and the welcome screen.


Workspace Selection

The ECLIPSE Welcome Screen

The screen content will vary based on the ECLIPSE version.
The screen content will vary based on the ECLIPSE version.

Step 3: Looking at the ECLIPSE Workbench

For reason which will become apparent, just close the welcome window for now. We will reinvoke it momentarily.

After closing the welcome window, you now see the ECLIPSE workbench. Its consists of a toolbar (File, Edit, Navigate, .......) a secondary line with a number of icons, and four main panels referred to as views. There are arranged 3 abreast starting initially with "Project Explorer" on the left and a fourth view below which is initially "Markers'. These views may be closed, rearranged, minimized or maximized, and restored to their initial configuration. This can be quite confusing for the newcomer.

The next step is really the "life raft", that is "I got here and have no idea as to get back to what I wanted to see.





The Workbench at Startup

The workbench consists of tool bars and 4 viewing areas.
The workbench consists of tool bars and 4 viewing areas.

Step 4: Resetting the Perspective and Welcome Page

At this point in would be advantageous to try manipulating the and looking at the toolbar definitions.

OK, now if you screen is "messed up", how do you get back to an initial state? From the tool bar, go to Window > Reset Perspective. "Perspective" is the name used for the "composite views". In our examples we are looking at a JAVA perspective.

Now, let's go back to see if we can get that welcome screen back. Again, this may not be obvious, but all you have to do is go to Help > Welcome on the toolbar.

Reset the Perspective

Getting back to the original perspective
Getting back to the original perspective

Getting Back to the Welcome Screen

The Welcome Screen is the starting point for tutorials.
The Welcome Screen is the starting point for tutorials.

The Eclipse Window in Tutorial Mode

Note the fur views are augmented by the Tutorial panel.
Note the fur views are augmented by the Tutorial panel.

Working Through the "Hello World!" Tutorial

Now that we have returned to the welcome page. We will work through the "Hello World!" tutorial.

First, click on "Create the Hello World Application. The next screen which appears shows the 4 views which referred to previously as well as a sidebar for the tutorial text. The text is rather self-explanatory.

Click on "click to Begin" in the tutorial window.

New text indicates what action is to be performed.. In this first step is indicates that you should go to the tool bar and select Window > New Perspective > Java. Optionally, (and if you get confused) you can click on "Click to perform". In either case the next action you want to perform is indicate that the step is complete by clicking "Click when complete" . The text for the next action to be performed is now indicated and the process is repeated.

The steps which follow:

  • Create a new Java project. In the case of my installation the text is a little misleading. It says to perform the action "click on the new Java project button in the main toolbar".. It's there but not obvious to a new user. It happens to be the first icon on the second line of the screen. In this case I might rely on the "Click to perform" text. You might explore and find that you could choose File > New > Java Project from the screens first line. I then enter "HelloWorld" as the project name, click on "FINISH". My screen is now update in the far left hand panel, the "Package Explorer" panel, with the new project "HelloWorld".
  • Create a new Java class. Again, for a new user it may be hard to identify exactly how to do this, but you can do File > New > Java Class from the first toolbar line, or in the second line there is a green circle with the letter C. Enter the name HelloWorld and enter FINISH. You might notice that a yellow triangular warning message appears regarding default packages. Don't worry about this now. We will discuss packages in the next tutorial. The following screen shot show you the structure of your project thus far. Note that the JRE (Java Runtime Environment) installed on your system is associated with your project.

The "HelloWorld!" Tutorial at this Point

Note the update changes which have taken place in the Package Explorer and Editor views.
Note the update changes which have taken place in the Package Explorer and Editor views.

Finishing the Hello World! Tutorial

We are now going to work with the editor view and insert a print statement. You add this statement after the line beginning with "// TODO...." which is a comment line in Java. As you type notice that the editor is "watching your actions" Future tutorial will discuss how the editor can help with suggesting code alternatives and help with syntax errors.

The final set is to run the application. You click on the class name in the Package Explorer view, and select Java application. The output is displayed on the console view on the bottom. This is illustrated below.



Window Snapshot after "Hello World!" Execution

Did we get it right?

How helpful was the tutorial in aiding you to complete the exercise?

See results

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: "https://hubpages.com/privacy-policy#gdpr"

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)