Results 1 to 6 of 6

Thread: Getting started on Stanford's Java Course

  1. #1
    Join Date
    Nov 2009
    Beans
    44

    Getting started on Stanford's Java Course

    I am taking Stanford's free online course in introductory programming (they also have more advanced courses for those interested).

    I am trying to run a java program through eclipse. The program is called StoneMasonKarel, which is a subclass of SuperKarel, a class where a robot moves around and does stuff. My version of eclipse seems to be slightly different than the one they are using, since I could not download their Mac or Windows version on their site. They say to simply click on an icon to run the program. I have to click 'Run As....' and then choose a configuration.

    I chose Java Application (out of the choices of Eclipse Application, Equinox OSGi Frame, Java Applet, and JUnit, and SWT Application). It was the only one that seemed to do anything. For the configuration I chose StoneMasonKarel as the main class.

    When I run it like this the little robot and his world pop up, but the application automatically freezes. I have tried with a couple really simple subclasses and the same thing happens. Could there be something wrong with my set up? Do you need any more info?

    The library and worlds - the skeleton of the program - is pre-programmed by Stanford. Thanks.

  2. #2
    Join Date
    Apr 2010
    Beans
    Hidden!

    Re: Getting started on Stanford's Java Course

    Can you attach the source code ( preferably tar.gz ) ?

    When I rebooted it, it got stuck at some GBRug command prompt ..

  3. #3
    Join Date
    Nov 2009
    Beans
    44

    Re: Getting started on Stanford's Java Course

    Code attached. I thought it might be a problem with my configuration rather than the code because it is basically just the code that Stanford uses for thousands of students. All I did was add a move command to the StoneMasonKarel subclass, which was previously empty. When I run it the application pops up, shown below, but it freezes before I get a chance to actually click on "start program" or anything else.

    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2009
    Beans
    44

    Re: Getting started on Stanford's Java Course

    Or would it help to try running it in another program? Any ideas? I don't want to take up a lot of anyone's time, but a quick suggestion would help, as I'm at an impasse.

  5. #5
    Join Date
    Feb 2009
    Beans
    789
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Getting started on Stanford's Java Course

    According to http://see.stanford.edu/materials/ic...in-eclipse.pdf, they use two special buttons to run the code of the robots. Given that they have special Eclipse versions, my guess is that they have extendend Eclipse with some functionality which the standard Eclipse doesn't have. By running it as a normal Java application, it's probably not starting the Karel simulator correctly (those extra buttons probably do some extra work under the hood before launching and it would be silly to add more buttons when a normal application launch suffices). If you want to run it, I think you should look into starting the Karel simulator and the code of a robot from the command-line, if that's possible at all. You could also email the teacher, perhaps he can help as he's more familiar with the system than we are.

  6. #6
    Join Date
    Nov 2009
    Beans
    44

    Re: Getting started on Stanford's Java Course

    Ohh, I see. I thought the run commands just had different icons. Thanks so much for looking into it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •