You are on page 1of 16

Eclipse tutorial

Contents 1. Overview 2. Download and Installation 3. Starting a New Project

Overview Eclipse Eclipse is an open source community whose projects are focused on providing a vendor-neutral open development platform and application frameworks for building software. The Eclipse Platform is written in the Java language and comes with extensive plug-in construction toolkits and examples. It has already been deployed on a range of development workstations including Linux, HP-UX, AIX, Solaris, QNX, Mac OS X and Windows based systems. -www.eclipse.org Eclipse is a free, open source, platform-independent software framework. This framework has been used to develop an IDE for Java. Download and Installation Eclipse can be downloaded from http://www.eclipse.org/downloads. This link automatically detects your OS and provides the latest release of Eclipse for your platform (You can also browse other builds by clicking on 'All Versions'). Choose a mirror and save the zip file. Eclipse comes as a zipped dump rather than an installation. All you need to do is just unzip it to a preferred location and you can start using it. If you are using Linux, you need to append this location to you path. You can add this line below to .bashrc file in your home to open Eclipse from shell. export PATH=$PATH:/usr/local/eclipse Here Eclipse is assumed to be unzipped to /usr/local. In windows system, you can just copy the link to Eclipse executable to your start menu to access it.

Starting a New Project Launching Eclipse prompts you for workspace location. This is where all your projects will be stored and you can choose a different location every time you start Eclipse or check the Use this as the default option.

After you enter a workspace location, you will be presented with the Startup screen as shown below:

Click on the Arrow at the top-right hand corner to go to Workbench or just close this and go on with the tutorial. Starting a new project: Go to File > New >Project.

This opens a wizard that helps you in creating the project.

Select 'Java Project' and press 'Next>'

Give project name and click finish. In the project explorer pane to the left, you can see the project and clicking on it opens the files/librabies associates with it. Currently only default System Library is present.

Add a new Java class to this project:

Name the class and check the public static void main option and click Finish.

This will take you to code window where you can enter the sample Java code. (Note that function help pane is opened while typing the code.)

In Eclipse, Projects are automatically built while coding. This helps in identifying syntax errors while coding. You can change this option in Project menu.

As the project is build, now its time to run the code: Go to Run Menu > Run and it opens a run configuration chooser if you are running the project for the first time.

Choose the type of application you are developing and create a new configuration of that type by double clicking on it. In our case, it is a simple Java application and we are creating a new configuration under Java Application.

Once you choose the application type, we need to specify the main function to start with. We can either specify it manually or use search. Pressing Search button pops up the following window. You can see that the main function is already found. If we have multiple main functions, we can choose the one to run initially.

Bingo! We successfully created a Java application using Eclipse.

You might also like