Results 1 to 15 of 15
  1. #1
    neu_mann is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default Karel the robot: errors during run

    Hi, I find following errors after running the programme (a very simple one)

    Exception in thread "Thread-3" acm.util.ErrorException: move: Karel is not living in a world
    at stanford.karel.Karel.checkWorld(Karel.java:295)
    at stanford.karel.Karel.move(Karel.java:77)
    at CollectNewspaperKarel.run(CollectNewspaperKarel.ja va:16)
    at acm.program.Program.runHook(Program.java:1568)
    at acm.program.Program.startRun(Program.java:1557)
    at acm.program.AppletStarter.run(Program.java:1895)
    at java.lang.Thread.run(Unknown Source)

    I have written a 3 line code:
    import stanford.karel.*;

    public class CollectNewspaperKarel extends SuperKarel {

    public void run(){
    move();
    turnLeft();
    move();
    }
    }


    I do not know whats wrong with it!! its so simple still i do not why,

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Most of the forum is not going to know about Karel, as it is pretty much a Stanford-only thing. Do you have your worlds directory, with CollectNewspaperKarel.w in it?

    -Gary-

  3. #3
    neu_mann is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default

    Yes I think I have it. This is actually one of those easy stanford assignments
    CS106A Programming Methodology
    I downloaded the zip file, extracted it and then loaded it on stanford customized Eclipse..
    Thanks for your reply..
    Actually I am following these lectures so wanted to do the assignments to get hands-on experience.

    Any suggestion is quite valuable for me as its my first programming experience....

  4. #4
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Well, I wish I could be more helpful, but all I can say is that there must be something wrong in your setup. Are you running Windows, Mac, or Linux?

    -Gary-

  5. #5
    neu_mann is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default

    windows XP

  6. #6
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Man, I want to go to Stanford too. Looks sexy
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by FlyNn View Post
    Man, I want to go to Stanford too. Looks sexy
    You can participate (watch) on youtube: here is the link.

    kind regards,

    Jos

  8. #8
    neu_mann is offline Member
    Join Date
    May 2010
    Posts
    4
    Rep Power
    0

    Default working

    Hey its working now, I just had to oldstyle delete/reinstall....:D,
    but Thanks guys..I have started liking this forum..

  9. #9
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    I'm glad you got it working. I strongly recommend you take a slight detour from the Stanford CS106A coursework, and go through the tutorial here:

    Eclipse and Java for Total Beginners

    This is about three hours total, and I think it will really make you feel more at home in the Eclipse environment. CS106A is about computer science principals, and it's an excellent course, but the Mark Dexter tutorials are more about nuts and bolts Eclipse and Java. They're just deep enough to give you a solid understanding, without taking up too much of your time. After you work through these, go back to CS106A, and then follow that up with the Sun Java Tutorials.

    -Gary-

  10. #10
    sonny's Avatar
    sonny is offline Senior Member
    Join Date
    Feb 2010
    Location
    North West England
    Posts
    146
    Rep Power
    0

    Thumbs up Karel the Robot

    Gary suggests a good link,, if your a total noob me. my suggestion would be to do at least the Karel the Robot exercises first to assignment one then mark dexters tutorial,, which is excellent

    I'm doing the same course but also doing a lot of detours as I go along.

    I had some problems installing the eclipse version provided in the zip file
    but the version here worked fine,
    CS106A Programming Methodology

    Here is a link to the course text books which you wont have got in the stanford Zip file,

    Karel the robot learns Java
    http://lia.deis.unibo.it/Courses/Fon...learnsjava.pdf

    The art and science of Java by Eric Roberts
    http://people.reed.edu/~jerry/121/ma...ciencejava.pdf

    best of luck
    Sonny
    Last edited by sonny; 05-06-2010 at 01:19 AM.
    :p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts

  11. #11
    Courtland is offline Member
    Join Date
    Apr 2011
    Location
    New England/Caribbean/Med
    Posts
    2
    Rep Power
    0

    Default Stanford CS106A

    Maybe we should start a CS106A Forum. I got stumped a number of times as well. Mainly because I did not know how Eclipse worked and I made all kinds of errors, probably corupted the Eclipse program a number of times and had to trash the Workspace files a number of times.

    I finally put that on hold and did the 16 tutorials in Mark Dexters "Eclipse and Java for Total Beginners"
    Eclipse and Java for Total Beginners

    That gave me a level of comfort with Eclipse which really helped when I got back into the Stanford Lectures.

    - Cheers

  12. #12
    Courtland is offline Member
    Join Date
    Apr 2011
    Location
    New England/Caribbean/Med
    Posts
    2
    Rep Power
    0

    Default Stanford U CS 106A & Karel the Robot

    I am new to Java. Does anyone know of a forum (or would want to start one) for Stanford Eclipse - or for their course " CS106A" ? I've had to modify or add to some of the Eclipse for JAVA assignments in CS106A in order to duplicate the problems shown in the Lectures and in the Assignments. I've had to create and save Worlds for Karel to run around in, etc. It has not been easy but I've begun to get a handle on it. I did the Turtorial "Java for Total Beginners" mentioned in this forum and that really helped. But, I seem to be spending more time trying to learn the ins & out of Eclipse rather than focusing on coding; syntax, decomposing, debugging, etc. which is the real heart of it (I think). Were I an on-campus student in the course, rather than taking the online (free!), lectures and course; I think I would have had a though time. I don't know how those kids do it. Anyway, I am here to help with what I know thus far but realize I am wasting a lot of time just getting to this point. It would be a real help to just ask: How do you create a new World for Karel to run in, save it as a Unix Executable file rather than a "txt" file and associate it with the Java Project or Java Class I'm working with. Those questions took me two days of searching and trial & error with Eclipse to find the answer.

  13. #13
    scotto703 is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Re: Karel the robot: errors during run

    > How do you create a new World for Karel to run in, save it as a Unix Executable file rather than a "txt" file and associate it with the Java Project or Java Class I'm working with. Those questions took me two days of searching and trial & error with Eclipse to find the answer.

    Several Karel examples have worlds associated with them that appear when the program is run. I would like to replicate the examples in the lectures by creating worlds (which is easy and I know how to do), but also associating them with the particular program I'm writing/demonstrating. I can use the "Load World" option, but would rather have the world loaded automatically when I run the program. Any ideas of how to do that without having the Karel code (just the .jar file)?

  14. #14
    chome4 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Re: Karel the robot: errors during run

    Quote Originally Posted by scotto703 View Post
    > How do you create a new World for Karel to run in, save it as a Unix Executable file rather than a "txt" file and associate it with the Java Project or Java Class I'm working with. Those questions took me two days of searching and trial & error with Eclipse to find the answer.

    Several Karel examples have worlds associated with them that appear when the program is run. I would like to replicate the examples in the lectures by creating worlds (which is easy and I know how to do), but also associating them with the particular program I'm writing/demonstrating. I can use the "Load World" option, but would rather have the world loaded automatically when I run the program. Any ideas of how to do that without having the Karel code (just the .jar file)?
    http://see.stanford.edu/materials/ic...in-eclipse.pdf

    I think you need to hit the icon of the little man rather than loading a world.

    Hope that helps.

  15. #15
    doubt is offline Member
    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Default Re: Karel the robot: errors during run

    Quote Originally Posted by neu_mann View Post
    Exception in thread "Thread-3" acm.util.ErrorException: move: Karel is not living in a world
    I just ran into this problem using standard (not Stanford) Eclipse. By now this is probably moot for you, but I'll post my solution for future travelers.

    The launch configurations for Assignment 1 default to Applet, so the containing Karel application isn't launched. To solve this, create and use new Application launch configurations for each file.

    If you already tried to run some of the files, delete the Applet configs created so you can reuse the names:

    1. Open the project properties (e.g. right click on Assignment 1 and select Properties).
    2. Select Run/Debug Configurations.
    3. Select and Delete each configuration.
    4. Click OK.

    Create Application configs:
    1. Right click on java file (e.g. CollectNewspaperKarel.java) and select Run As > Run Configurations...
    2. Select Java Application in the left pane.
    3. Click New Launch Configuration (the icon of a document with a +).
    4. Type a name for the configuration and set its Main class to the associated file (e.g. CollectNewspaperKarel).
    5. Click Apply then Run. (This should run correctly and create a useful entry in the Run History.)

    Eclipse will still try to default to Applet, so you will henceforth need to launch these configurations from the Run History (either from the Run menu or the pull down on the run button). If you accidentally launch as default, it will add a useless Applet configuration to the Run History (e.g. CollectNewspaperKarel (1) ). You can delete this from the Run Configurations dialog to keep the Run History tidy.

    May the Force be with you.

Similar Threads

  1. Robot Game
    By Galore in forum New To Java
    Replies: 7
    Last Post: 03-21-2010, 06:14 PM
  2. Help with Robot Class
    By protocos in forum Eclipse
    Replies: 11
    Last Post: 10-05-2009, 08:15 PM
  3. Karel the robot
    By vulerious in forum New To Java
    Replies: 0
    Last Post: 07-31-2009, 09:48 PM
  4. Replies: 3
    Last Post: 03-08-2009, 01:51 AM
  5. Robot Class
    By Jessie Madman in forum New To Java
    Replies: 3
    Last Post: 05-15-2008, 04:13 AM

Posting Permissions

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