Eclipse Tutoria

Embed Size (px)

Citation preview

  • 7/29/2019 Eclipse Tutoria

    1/16

    Eclipse tutorial

    Contents

    1. Overview2. Download and Installation3. Starting a New Project

    Overview

    Eclipse

    Eclipse is an open source community whose projects are focused onproviding a vendor-neutral open development platform and application

    frameworks for building software. The Eclipse Platform is written in theJava language and comes with extensive plug-in construction toolkits

    and examples. It has already been deployed on a range ofdevelopment 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 softwareframework. 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 releaseof Eclipse for your platform(You can also browse other builds by clicking on 'All Versions'). Choosea mirror and save the zip file. Eclipse comes as a zipped dump ratherthan an installation. All you need to do is just unzip it to a preferredlocation and you can start using it.

    If you are using Linux, you need to append this location to youpath. You can add this line below to .bashrc file in your home toopen 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 toyour start menu to access it.

  • 7/29/2019 Eclipse Tutoria

    2/16

    Starting a New Project

    Launching Eclipse prompts you for workspace location. This is whereall your projects will be stored and you can choose a different locationevery time you start Eclipse or check the Use this as the default

    option.

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

  • 7/29/2019 Eclipse Tutoria

    3/16

  • 7/29/2019 Eclipse Tutoria

    4/16

    Click on the Arrow at the top-right hand corner to go to Workbench orjust close this and go on with the tutorial.

    Starting a new project:

    Go to File > New >Project.

  • 7/29/2019 Eclipse Tutoria

    5/16

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

  • 7/29/2019 Eclipse Tutoria

    6/16

    Select 'Java Project' and press 'Next>'

  • 7/29/2019 Eclipse Tutoria

    7/16

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

  • 7/29/2019 Eclipse Tutoria

    8/16

    Add a new Java class to this project:

  • 7/29/2019 Eclipse Tutoria

    9/16

    Name the class and check the public static void main option and clickFinish.

  • 7/29/2019 Eclipse Tutoria

    10/16

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

  • 7/29/2019 Eclipse Tutoria

    11/16

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

  • 7/29/2019 Eclipse Tutoria

    12/16

    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 youare running the project for the first time.

  • 7/29/2019 Eclipse Tutoria

    13/16

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

  • 7/29/2019 Eclipse Tutoria

    14/16

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

  • 7/29/2019 Eclipse Tutoria

    15/16

    Bingo!We successfully created a Java application using Eclipse.

  • 7/29/2019 Eclipse Tutoria

    16/16