06-karel-in-eclipse

06-karel-in-eclipse - Mehran Sahami CS 106A Handout #6...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Mehran Sahami Handout #6 CS 106A September 26, 2007 Using Karel with Eclipse Based on a handout by Eric Roberts Once you have downloaded a copy of Eclipse as described in Handout #5, your next task is to understand how to write Karel programs using the Eclipse framework. Although it is not all that hard to create new Eclipse projects from scratch, it certainly reduces the complexity of assignments if we provide starter projects to get you going. That way, you can ignore all the mechanical details of making new projects and focus instead on the problem-solving aspects of the assignments. Downloading starter projects The first step in working with any Karel assignment is to download the starter project for that assignment. If you go to the CS106A assignment page (go to the CS106A web site and click the Assignments link), you’ll see a display that looks like something this: If you click on the link for Assignment1.zip , your web browser will download the starter folder. In some cases, the browser will also unzip/extract the folder automatically, assuming that you have the appropriate software for expanding files from a ZIP archive. The notes on the assignment page above tell you what software you need. The unzipped contents of the ZIP file is a directory named Assignment1 that contains the project. Move that folder to someplace on your file system where you can keep track of it when you want to load the project. Importing projects into the workspace From here, your next step is to start up Eclipse, which will bring up the Eclipse window shown on the last page of Handout #5. Find the small icon in the toolbar that looks like:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
– 2 – This button is the Import Project button and is used to copy a project folder into the Eclipse workspace so that you can work with it. Click on this button and then use the Browse option to find the Assignment1 folder. When you do so, Eclipse will load the starter project and display its name in the Package Explorer window like this: The small triangle to the left of the folder name indicates that you can open it to reveal its contents. When you click on the triangle, it exposes the first level of the package: Note that you likely may not see the "JRE System Library" line displayed in the graphic above (or if you do, it may have a different number like 1.5 or 1.6, rather than 1.4.2). Nevertheless, at this point things look a more promising – there is something about Karel there on the last line. But things get more interesting when you open the default package, which is where the code you will write this quarter will go. Opening this package reveals
Background image of page 2
– 3 – Now things have gotten much more exciting. There—right on the screen—are the Java files for each of the assignments. You can open any of these files by double-clicking on
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/15/2010 for the course CS 106A taught by Professor Sahami,m during the Fall '08 term at Stanford.

Page1 / 8

06-karel-in-eclipse - Mehran Sahami CS 106A Handout #6...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online