CS3340:   Intro OOP and Design

 

How to Use Eclipse

Important: there will/may be differences in the exact interface with the version of Eclipse you are using. However, this will help you get started. PLEASE see Elcipse.org for more details and instructions on how to use the current version

 

Step 0: Select Language to develop in IF you have multi-language support installed for Eclipse

If you have multiple languages installed for Eclipse you will have the option to select which language. In this
version, there are buttons on the upper right area of the IDE. Note I can choose between PHP and Java. For
this demo will choose Java as shown.

Select Langage- here Java choosen

 

Step 1: Create a Project (here shown for Java)

Select File->New->Java Project

File New Project

 

 

You will get the following pop-up window, where you need to minimally enter in the name of the project.

I have entered "TestApp"
New Project Setup

 

HIT Next, and you will get this next interface, you can change the source folder and bin folders for output if you wish,
other tabs, include libraries (packages in java) you may want to include (import)
Setup SRC info

After you hit finish, the project is created, This is what you will now see. Note: I have more than one Project in my Eclipse
but, you see that TestApp is listed and has a src and bin directories (folders)
New Project is created

 

Step 2: Now you are ready to create source code.

there are many ways you can do this. For example:

    • You can copy in already existing java code to the src directory
    • You can create a new class, click on src folder and do "File->New->Class". The following interface will pop-up. Note I am making a class called "TestApp" that has a main method.

create new class

Now, the project will have a new src file and you can see it is called "TestApp.java" and it has the main method I asked for.
class file beginning

 

NOW, it is time for you to enter in some code.....I am going to add the simple line to printout a message.
println added to code

 

 

Step 3: Time to compile and run

There are a number ways to do this.

  • go to menu "Run->Run" or if you want to debug "Run->Debug"
  • Hit the Green "Run" button (looks like a "play button")
  • Here is the result of running our program
  • Run the code

 

© Lynne Grewe