Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#292 multiple worlds are created until program runs out of memory

open
nobody
Other (56)
9
2012-10-02
2012-10-02
Kathy
No

Hi, I am in a Java I programming class and we are using "Exploring Wonderland: Java Programming Using Alice and Media Computation", by Wanda Dann et al, as the text book. My DrJava installation on my new Windows 7 PC was working just fine for the first 2 weeks, but a week and a half ago, early into Chapter 4, it started acting crazy. When I tried a simple variable declaration (that I had already successfully done at previous sessions on same PC), DrJava started creating non-stop multiple worlds alternating between empty worlds and ones with various colored turtles until the program says it has run out of memory. Nothing I try will stop this from happening. I have tried uninstalling and re-installing DrJava (drjava-stable-20120818-r5686), as well as uninstalling the JDK (jdk1.7.0_07) and JRE (jre7), and the bookclasses and all other related files then re-installing also. I've asked at school and searched and searched online for some solution or to see if anyone else has had this problem, but haven't found anything yet. Now I'm more than a full week behind in homework and struggling to understand what's going on in the class. Any help anyone can give me at all would be so very much appreciated! I've attached a pdf with a screenshot and the details from the Interactions pane if that may help. Thanks so much, Kathy Coyne

Discussion

  • Kathy
    Kathy
    2012-10-02

     
    Attachments
  • Kathy
    Kathy
    2012-10-02

    • priority: 5 --> 9
     
  • Mathias Ricken
    Mathias Ricken
    2012-10-02

    Hi Kathy,

    Are the Turtle.java and World.java files that you wrote? If so, can you please attach them? If not, can you tell us where to find them?

    Thanks,

    --Mathias

     
  • Kathy
    Kathy
    2012-10-02

    Hi, Thanks! I wasn't expecting a response so quickly... No, I did not write the Turtle.java and World.java files. Here is the link to the page we were given to download the course software, etc.: http://wps.prenhall.com/ecs_wonderland_1/. I did delete the all the files I downloaded the first time, emptied recycle bin, cleared temporary files, cache, etc., restarted PC, and then started over again from scratch -- several times -- but still the same problem... Thanks again, Kathy

     
  • Mathias Ricken
    Mathias Ricken
    2012-10-02

    Hi Kathy,

    I downloaded the files from the website you gave me; extracted the files as instructed; added the bookClasses folder, the javazoom.jar, jmf.jar, and sound.jar files to the "Extra Classpath" in DrJava's Preferences pane; opened Turtle.java and World.java like in your screenshot; and then hit compile.

    When I type in the following, I get a window with a turtle, and no error.

    Welcome to DrJava. Working directory is C:\Users\mgricken\Desktop\intro-prog-java\bookClasses
    > World world = new World()
    > Turtle turtle = new Turtle(world)
    > world
    A 640 by 480 world with 1 turtles in it.
    >

    Have you changed any of the files before typing in the two lines that give you the error? Did you download the files exactly from that website?

    I'm a bit suspicious, because the line numbers in your screenshot don't match up with what I have in my file. For example, it shows

    at Turtle.<init>(Turtle.java:74)

    multiple times, which means DrJava is executing something in line 74 of the Turtle.java file. My Turtle.java file only has 70 lines.

    It is very unlikely that this is something that can be fixed by restarting your computer, or uninstalling the JDK and JRE.

    Can you go talk to a teaching assistant about this? I suspect that the Turtle.java file is not the same as the file I downloaded, and that there is a mistake in those changes.

    Thanks,

    --Mathias

     
  • Kathy
    Kathy
    2012-10-04

    Hi Mathias,

    Thanks so much! Because I always saved a working copy of the downloaded .java files to use for exercises, I thought the original files were unedited. I'm afraid that I never actually looked at the files to verify that they were intact before I saved what I thought was a fresh working copy. Sure enough there were a few lines of bad code in the Turtle.java file. I deleted those files and downloaded them again and now everything is working just fine. Good lesson learned. Sorry if I wasted your time, but thanks again for the help! Kathy