After knowing what Integrated Development Environments (IDE) are, and watching the beauty of working with them by trying NetBeans as an example, it is time to try another great tool: Eclipse. So, please join us to learn about Eclipse.
To get our copy of the Eclipse software, we need to download it. The following procedure will show us how to download Eclipse:
1. In your web browser, navigate to https://eclipse.org/
2. Click Download.
3. In the Downloads page, click Eclipse IDE for Java EE Developers.
4. Under the Download Links Section, choose the suitable version for your system (Windows, Mac, or Linux. And either 32-bit or 64-bit).
5. Once, the download starts, it shouldn’t take more than three minutes.
1. The downloaded package file is a zip archive file. All we need to do is to extract it exactly as we do with any other zip file. So, right-click the downloaded file and choose Extract Here.
2. A folder named eclipse is extracted. Double-click to open the folder.
3. Double-click the eclipse.exe file to start Eclipse. After displaying the splash screen for few seconds, you will get a dialog box that asks you for the preferred workspace directory.
4. You could simply click OK to use the default folder, or click Browse to choose another one, or simply type the path of the folder you want to use as your workspace directory.
5. Check the “Use this as the default and do not ask again” check box, then click OK.
6. Eclipse start loading the necessary components and modules. This should take few seconds.
7. The Eclipse main window is open.
Now, the show is about to start. Enjoy!!
In this section, we are going to learn how to create a Java project, type Java program, compile it, build it, and test it in action. The following steps illustrate the procedure:
1. Click File New Project
2. Select Java Project, and then click Next.
3. In the New Java Project dialog box, type FirstProgram as the Project Name, and then click Finish.
4. You should get a window like this:
5. In the Package Explorer pane (on the left side), expand the Hello project.
6. Right-click the src folder to get a long menu. In this menu click New File
7. In the New File dialog, type Hello.java as the file name, and then click Finish.
8. An empty file is opened in the right pane, and ready for editing. Type our first Hello program in the empty file.
9. While typing you will encounter some interesting things, like the following dropdown list that is displayed when type System. (System followed by dot)
10. This will occur again when typing . (dot) after the word out. The dropdown list displays the possible methods for the object out.
11. When finished, Your file should appear like this:
12. In the toolbar on the top of the Eclipse window, click the Green arrow to run the program.
13. Now, the bottom right pane displays the expected Hello message.
That is it!!!
* * * * * *
In this article, we have learned how to download and use Eclipse. We have illustrated in details the procedure to create a Java project, create a source code file, type Java code, use auto-completion feature, and finally, how to test the typed program by running it, and watching the output.
I hope you like this article, and find it useful.
See you in the next article.