what is eclipse? - pacific universityzeus.cs.pacificu.edu/.../lectures/02.eclipseversionjava.pdf ·...

16
What is Eclipse? • Eclipse – Integrated Development Environment (IDE) that contains an editor, compiler, and debugger among other things – Requires a Java Runtime Environment – Can develop Java, C, C++, ... programs

Upload: others

Post on 26-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

What is Eclipse?• Eclipse

– Integrated Development Environment (IDE) that contains an editor, compiler, and debugger among other things

– Requires a Java Runtime Environment– Can develop Java, C, C++, ... programs

Page 2: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Workspace Launcher

Page 3: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Make sure the perspective is Java

Select the perspective for coding

Page 4: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Change your perspective by clicking the icon above. Then select Other and finally the perspective you want

Changing your perspective for coding

Page 5: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Create a new HelloWorld projectFile → New → Java Project

Type in the project name HelloWorld

Page 6: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

After clicking the Next buttonYou can define the build settings

Page 7: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Make sure your perspective is Java

A HelloWorld project

Page 8: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

No source file exist yet

What's in a new HelloWorld project?

Page 9: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Create HelloWorld.java?

public class HelloWorld{ public static void main (String[] args) {

System.out.println ("Hello World"); }}

Page 10: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Right click on src, then New->Class

Page 11: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

For now, type HelloWorld in Name and leave Package blank

Page 12: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Finish typing in the HelloWorld program

Page 13: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Completed Program

Page 14: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

How to run your program?Make sure the program is savedRight click on the HelloWorld project icon and Run->Java Application

Page 15: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Run versus Debug

Debug Run

Page 16: What is Eclipse? - Pacific Universityzeus.cs.pacificu.edu/.../Lectures/02.EclipseVersionJava.pdf · 2011. 7. 1. · Eclipse SDK stores your projects in a folder called a workspace

Printing• Windows | Preferences • General | Appearance | Colors and Fonts• Make any necessary changes

• Print doubled sided!