Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » trying to run - first time(no main type found)
trying to run - first time [message #789359] Thu, 02 February 2012 22:30 Go to next message
Yoel Frischoff is currently offline Yoel FrischoffFriend
Messages: 1
Registered: February 2012
Junior Member
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();
}
}

Re: trying to run - first time [message #789388 is a reply to message #789359] Thu, 02 February 2012 23:20 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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.
Re: trying to run - first time [message #789495 is a reply to message #789359] Fri, 03 February 2012 03:24 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1441
Registered: July 2009
Senior Member
On 02/02/2012 04: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
>

After seeing a number of posts in the Eclipse forums about Karel, I took
a look at the Stanford web site. Apparently Karel is a language
developed by Stanford. It is like Java, but it is not Java. There is
also apparently some Eclipse tooling that can be used to write Karel
programs.

Both the language and tooling are Stanford products. I doubt that you
will be able to get much help on the Eclipse forums. These forums are
meant for helping use the Eclipse tools not third party tools.

You should look into what support Stanford provides for their
language/tools.

>
> 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();
> }
> }
>
>
Previous Topic:Fresh install on Mac OSX... Eclipse won't run
Next Topic:Identify eclipse bit version
Goto Forum:
  


Current Time: Mon Jun 14 16:22:06 GMT 2021

Powered by FUDForum. Page generated in 0.03119 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top