Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Eclipse Programming with an Integrated Development Environment.

Similar presentations


Presentation on theme: "Introduction to Eclipse Programming with an Integrated Development Environment."— Presentation transcript:

1 Introduction to Eclipse Programming with an Integrated Development Environment

2 What’s an Integrated Development Environment? We need a tool to… –Help us write the code –Help us test the code –Help us debug the code –Help us fix the code –Help us deploy the code A tool that does all these things in a single application is an Integrated development Environment (IDE) We’re going to use Eclipse

3 Layout of a Java Program WorkspaceProjectSource Folder Source Files

4 Starting Eclipse Select Eclipse from Start Menu Select a folder for your Workspace (to be defined next) – this option may not appear. If not, just use the default –My Documents is safe on class computers

5 Starting Eclipse

6 Eclipse Workspace/Project Create a new C Project –This will create a Workspace the first time through

7 Eclipse Workspace/Project Give it a Project name Select “Empty Project” under Executable Press “Finish” –This creates a Workspace (1 st time) –Also creates a Project within the Workspace –Subsequent new projects will be added to the existing workspace

8 Workspace/Project You may have to close the welcome screen to see this view Just press the X on the “Welcome” tab

9 Source Folder Create a new Source Folder

10 Source Folder Give it a name

11 Source File Create a Source File

12 Source File Give it a name

13 Workspace/Project Note that a Workspace can contain 1 or more Projects –You might want to create a project for each class you have –You might want to create a project for each assignment within a class –It’s all up to you The message here is ORGANIZATION!!! It is critical if you want to be a successful computer scientist!!!

14 Workspace/Project/Folder/File

15 Adding Code Type in the code from page 7 of Kernighan and Ritchie Save the file (File->Save or ^s)

16 Build the Project Build the project –This will run the C compiler and the linker –You will be told of warnings and errors in your program –You must fix errors –You should fix warnings

17 Running the Program Run->Run As…

18 Running the Program Note the results in the console window

19 Congratulations You’ve just created a working C program! Note that the Eclipse Integrated Development Environment (IDE) is persistent therefore your screens may vary from what you just saw What does Integrated Development Environment mean? What does persistent mean?

20 Transporting a Project (Export out of Eclipse) File -> Export…

21 Transporting a Project (Export out of Eclipse) Select General ->File system Click Next

22 Transporting a Project (Export out of Eclipse) Select src (should be selected) Browse to a location Select Finish This will place the source files (src files) in the selected folder

23 Transporting a Project (Import into Eclipse) Create a project like we did previously but do not create the source file File -> Import… Make sure the “src” folder is selected

24 Transporting a Project (Import into Eclipse) Highlight General -> File System Click Next

25 Transporting a Project (Import into Eclipse) Browse to the folder you created when you exported the project Check the c file you exported Browse to your project src folder (if it’s not already shown) Click Finish

26 Transporting a Project If something goes wrong during the Import step, don’t panic, you still have the.cfile(s) in the folder you created during the Export step You can go back and try it again

27 The program #include main() { printf("hello, world!\n"); } Get access to external codeProgram starting function String constant Formatted output function Statement terminatorStatement block

28 Let’s experiment…


Download ppt "Introduction to Eclipse Programming with an Integrated Development Environment."

Similar presentations


Ads by Google