ShmoopTube

Where Monty Python meets your 10th grade teacher.

Search Thousands of Shmoop Videos

Computer Science: Eclipse 2 Views


Share It!



Transcript

00:02

Setting up your environment with Eclipse... Well, Carmen the carpenter ant

00:07

is off to a great start with her fancy new text editor, you know, up and running. [Carmen at computer]

00:12

But when she heads home at night to her little room with a knot in the wood, she

00:16

stares up the sky and dreams of more. When Carmen opens up her computer each [Carmen dreams]

00:21

day, you know, her trusty Appleseed, she keeps running into errors that she can't

00:26

figure out. There's got to be a better way to solve these problems before [Carmen has computer errors]

00:30

Carmen breaks an antenna, and there is. Yeah, it's called Eclipse. Eclipse, the

00:36

moon, the myth, the legend. Love it or hate it, this I.D.E is of fan favorite for Java [Eclipse logo pictured]

00:41

learners, probably because it's free... or because it has a great debugging [pros and cons list]

00:46

environment. Yeah, that's why. Well, setting up an I.D.E on Carmen's computer is going

00:50

to take a lot longer than a straight text editor, but on the other hand, she

00:53

won't have to worry about the terminal part. Here's the eclipse download page.

00:57

Fittingly, Carmen's going to download Neon to match her neon sun. Your version

01:03

might be totally different, but it should still have the same functionality. Don't [Carmen downloads Eclipse]

01:07

worry about hunting down your exact build. All the functions you need will

01:10

be about the same... you know, knock on wood. Carmen is going to download the "Eclipse

01:15

I.D.E. for Java Developers" thingy and run the setup process on the computer by

01:21

unzipping the file. For Mac, like that fancy seed-based computer Carmen has, the [Carmen runs setup process]

01:27

file's going to be a .tar file for Windows it'll be a .zip file. Well, Carmen doesn't [file types explained]

01:33

really know what the other versions of Eclipse mean, so she's just going to

01:37

install Eclipse I.D.E. for Java developers, which is a all she really needs anyway.

01:42

Well, after it's downloaded and installed, she'll need to find the Eclipse

01:46

application on her computer. If she was on a Windows computer, Eclipse would

01:50

create a shortcut to her desktop, but since she's on a Mac, she'll head to the [Carmen finds Eclipse application on computer]

01:55

applications directory and find it right there. It will open and ask her for a

02:00

workspace. A workspace is where all the Java files are going to be saved and run

02:04

by Eclipse. Well, Carmen's going to pick a handy

02:07

location--her floorboard folder--and press "OK." Since you live in a house [Carmen enters workspace]

02:13

probably use a non insect-based computer, you might pick the "home" folder instead. [human picks home folder]

02:19

If Carmen did everything right, she should be looking at an empty window. [empty window pictured]

02:23

There we go, perfect. She's crawling for action, though, so she's got to fix that.

02:27

By heading to the top-left corner, she finds an icon of a file with a plus sign.

02:33

When she clicks the down arrow and select project--all right, there we go--

02:39

she'll get a setup wizard for creating a... wait for it... project. In the ant [setup wizard appears]

02:44

world, setup wizards build the entire ant mound for you, putting all the worker

02:48

ants out of business. In Eclipse, though, they're just a series of windows that [setup wizard ant works some magic]

02:53

help you set up different Java files. A project is a place where Carmen will

02:57

want to collect all the Java files for an individual set of code units. You know,

03:02

like a game or an app. Well Carmen likes to think of a project as her ant mound

03:07

as far as code goes. You know, like the way ants all come back to the home base, [ant mound comparison]

03:11

crawling all over each other to get things done. All right, well all the Java

03:14

files for a project should end up in their project, cleverly. Since it doesn't

03:20

really matter what her project looks like just yet, she can name the project

03:23

anything she wants. We recommend something clever, like "first project." [Carmen names project]

03:29

Yeah, we did some serious brainstorming to come up with that idea. Genius. Check [writing staff rejoices]

03:33

out the project layout section. If you remember from using the text editor,

03:37

there was a command called Java C that created a class file. Well, the class file [class file explained]

03:42

is what the computer actually runs. All right, now back to the project layout.

03:46

Eclipse is asking how to separate out the .java files from the .class [Carmen sorts files]

03:51

files right here. If Carmen wants all the files together in one ant mound, she

03:56

should click on "Use project folder as root for sources and class files." If she

04:01

wants the sources separated from the class files,

04:04

she should click the "Create separate folders" option instead. Well, that choice

04:09

is probably going to depend on the project, but generally with bigger

04:11

projects, you'll want to separate things out, right? Well, click "finish," and Carmen

04:16

sees an empty screen again. Now, it's time to create the Java file that will [empty screen pictured]

04:21

actually run. Well, she heads back to that icon of a page with a plus sign and

04:26

clicks the down arrow. This time, instead of making a new

04:29

project, she clicks on class. Well, every piece of code Carmen will write in Java [Carmen clicks on "class"]

04:34

is going to be in a class, no matter how small or large the project

04:39

gets. She's getting a little antsy, so finally making it to the class is a good

04:44

thing. All right, but not so fast... The class creation screen first needs to [Carmen sets up class creation screen]

04:48

know a couple of things. Number one, the source folder.

04:51

Number two, the name of the class. Well, the source folder is where the file

04:56

should go in your computer. Carmen is going to put it in "first project" under

05:01

SRC, since she created that project just for this file. All right, and then she'll

05:06

need to name the class "first program" to match the name at the top of the Java [Carmen names class]

05:11

program we had before. Well, there's just one more thing she'll want to do before

05:15

pressing that finish button. Under the "Which method stubs would you like to

05:20

create?" question, she checks the "public static void main(String[] args)." Well, Carmen

05:26

doesn't need to know what it means at this point--just that she needs it for [Carmen clicks method stubs option]

05:29

this first program. She's so good at following directions. call it good ant-stincts.

05:34

Then, she'll press finish. If you did everything like Carmen did, well, you [Carmen finally presses "finish"]

05:39

should get this screen. If you'll remember from before, this already looks

05:42

a lot like the program carmen made in brackets, but she no longer needs to type

05:47

everything out. To finish off the program, she'll just copy and paste the only line

05:51

not yet in this new Eclipse class. Then, she'll save the file and it's ready to [Carmen copies and pastes]

05:56

go. Clicking on a green circle with left arrow will tell Eclipse to compile and

06:00

run the program all in one go. The fact that it does both steps at once

06:05

cuts down on a whole command, which is pretty sweet. And just like in the [Eclipse function explained]

06:10

command line, "Hello, fellow bugs!" shows up at the bottom of the screen, [command shows up in console]

06:14

which Eclipse and everyone else calls the console. Just to be clear, Eclipse is [ants aren't very nice]

06:20

compiling the program; it just isn't showing the step where it converts Java

06:25

into the computer's code. So let's take out a semicolon from system.out.println [semicolon removed]

06:29

to see what happens. Well, Carmen might be a good beginner

06:34

programmer, but she'll forget that little semicolon just about all the time, so

06:39

she'll need to know what this looks like. The only way she'll end [compilation error shown]

06:42

up with a compilation error is if a computer tries to compile code and it

06:47

doesn't work, which is how we know Eclipse is running that Java C

06:51

compilation step. As long as Carmen follows all the little red Xs and gets

06:55

rid of the errors, well she can run the program again. Now she's ready for bigger

06:59

and badder programs to help her lightbulb research project. [Carmen stares at lightbulb]

07:03

Someday, you'll reach that big light bulb in the sky there, Carmen. Someday. [Carmen in Shmoop meeting room]