|
Re: trying to run - first time [message #789388 is a reply to message #789359] |
Thu, 02 February 2012 23:20 |
|
On 2/2/2012 3:30 PM, Yoel Frischoff wrote:
> When running a program (OurKarelProgram) or another one, a message
> dialog pops: "Workspace does not contain a main type (do you have a
> public void run() method?"
>
> Mac OSX 10.7.2
> Eclipse 3.6
>
> Ideas?
>
> Thanks, Yoel
>
>
> Here is the code:
>
> /*************************************************
> * File: OurKarelProgram.java
> *
> * A simple Karel program where Karel picks up a
> * beeper and carries it up a hill.
> */
>
> import stanford.karel.*;
>
> public class OurKarelProgram extends Karel {
> public void run() {
> move();
> pickBeeper();
> move();
> turnLeft();
> move();
> turnLeft();
> turnLeft();
> turnLeft();
> move();
> putBeeper();
> move();
> }
> }
I assume this code is not yours. Look for a class with:
public void main( String[] args )
inside. That's the class to (attempt to) run.
|
|
|
|
Powered by
FUDForum. Page generated in 0.09438 seconds