This Introductory Tutorial Explains What Is Eclipse and How to Download, Install, & Configure Eclipse Workspace on Your Machine:
While deciding to automate your test cases, one of the most important factors is to decide the language that you will use to go ahead with automation.
Nowadays, there are many languages available, however, Java is one of the most commonly used languages. It is being said that Eclipse is the most commonly used IDE for Java development. Here is a Series of in-depth Eclipse tutorials that will guide you through the basics of Eclipse in detail.
This Java Eclipse tutorial will help testers to understand what Eclipse is and how you can configure it on your machines for Java.
Table of Contents:
What is Eclipse?
Eclipse is an IDE or an Integrated Development Environment that provides support for the development of Java projects. It also provides support to many other languages like C, C++, PHP, etc.
This tutorial will explain the nuances of Eclipse by considering core Java however if you understand the basic functioning of the tool, you may be able to apply the knowledge to other languages as well.
Eclipse is simply explained as a tool that provides advanced editors to write, compile, debug and run your code. It provides features to easily structure the code of your project which thereby makes it readable and understandable. This tutorial will explain all of these features in detail.
Installation and Software Required for Eclipse
Eclipse is a freeware which means it is available for free download and does not require any licensing. It is a Java-based application, thus before installing Eclipse, you must have a JDK installed on your computer.
Both Eclipse and Java have numerous versions releases yearly or more and you must understand the combination that you need for your IDE to work properly.
The most recent releases of Eclipse include:
- Eclipse Photon (4.8): Released in June 2018
- Eclipse Oxygen (4.7): Released in June 2017
- Eclipse Neon (4.6): Released in 2016
Eclipse Photon and Oxygen require a Java 8 or newer JRE/JDK whereas Neon requires a Java 8 JRE/JDK. As we are going to use Eclipse mainly for development it is suggested to install a JDK.
Here, we will not go into the details of installing Java on your system, however, we will see a few quick steps that you can follow to install Java:
- Go to the Oracle Java downloads page for Eclipse Java download.
- Select the JDK that you want to download and install. As you scroll down on the page, you will see multiple versions of JDK available, choose the one that fits your needs based on the Eclipse that you want to download.
- Follow the installation instructions and install the Eclipse JDK.
Once you have JDK on your system, you are set to install Eclipse.
To install and configure Eclipse, you can do the following:
Go to the Eclipse download page and you will see something like below.
On that page the latest version will be displayed for download, you can directly click on download 64 bit (this depends on the OS you have on your machine) or click on download packages to view more packages available.
On clicking download packages, the following page will be displayed with multiple Eclipse versions.
You can choose to go with the latest version, or if you want to go with a previous version, click on the one you want from the highlighted other versions. Once you click on that a similar list of available Eclipse IDE download links will be displayed for that version.
For Example, if you click on Eclipse Neon, you will get a list of Neon IDE downloads.
Select Eclipse IDE for Java developers and select the download link from one of the below depending on the operating system of your machine.
For a windows system, you can check your OS type from your system information, by going through the control panel.
Once you select the OS type download link, you will be redirected to the following page.
As soon as you click the highlighted link, the download begins and after some time the downloaded zipped file will be saved in your machines downloads folder.
Extract the contents of this Zip folder, and you will get a folder by the name of “Eclipse” and place this in the C drive.
You should see the below folder structure once you are done with the above steps.
Eclipse IDE does not require installation, once you have this folder structure look for the Eclipse executable file highlighted above. Launching this executable file opens the IDE for your use.
Setting Up Your Eclipse Workspace
Once you have the Eclipse application on your machine, you can launch the IDE simply by clicking on the executable file. However, the first time you open Eclipse, you will be asked to create a workspace.
A workspace is a location on your machine where all the work you do through Eclipse will be stored as files. It is easier to create one workspace and save it as default so that your application remembers your past work.
Once you open Eclipse, you will see the below image.
The following window will show up after a few seconds.
Here you can see the highlighted default workspace location. If you are fine with this, then simply click the launch button. If you want to create a workspace in a specific location on your machine, then browse to that folder and then click launch.
You can see the checkbox asking to use the location as default checked, this is to ensure that the next time when you launch Eclipse it automatically opens the same workspace, so that you have access to all the work saved in this location.
After clicking the launch button, it may take some time for the Eclipse workbench to open. This is because the workspace is being created or in case of an existing workspace, the projects, etc. maybe fetched. Hence, do not worry if it takes a few minutes.
Once the workbench is launched, you will see the following default view.
This default view is the welcome page of Eclipse. As a beginner, you may want to read through some of the links given regarding the tutorials or samples to gain a better or detailed understanding. You can also read through the “What’s new” section to see what this latest version of Eclipse has.
If you do not want to see the welcome page when you launch Eclipse in future, then you can turn it off by unchecking the checkbox highlighted at the bottom of the page or you can simply close the welcome page by clicking on the closed sign on the title of the welcome page.
After closing the welcome page, you will see the following view.
At this point, you have successfully launched your Eclipse IDE workbench and are ready to start creating your first code.
Before we get into creating projects and writing actual codes, there are few more setup related things that you must know. These are environment variables. Eclipse automatically configures itself to the available JRE in the system, if you have set the environment variables at the time of setting up Java.
The primary environment variables include:
- JAVA_HOME: Point to JDK folder.
- JRE_HOME: Point to JRE folder
- Path: It is added above the locations to an existing variable. Please ensure that you do not delete anything that is already present in this variable, just add your new folder locations.
In Eclipse, if you want to update any path related to Java files, then you can do this by going to preferences (Go to top menu item Window-> Preferences) and the below window will open up.
However, do not get confused with this now. We will discuss more on this while we are creating and working with projects.
Summary
In this tutorial we have learned about the following:
- What is Eclipse?
- How to download and configure Eclipse on your machines.
- Setting up your workspace.
These are some of the basic topics, however, if you can understand these, you will be able to explore more on your own. Eclipse has many more advanced features that can be explored. This tutorial will give a great start to your test automation or any other type of code that you are looking to work on.