my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Exceptation in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exceptation in thread "main" java.lang.NoSuchMethodError: main" Watch "Exceptation in thread "main" java.lang.NoSuchMethodError: main" New topic
Author

Exceptation in thread "main" java.lang.NoSuchMethodError: main

ner ieru
Greenhorn

Joined: Feb 12, 2009
Posts: 7
GuessGame.class:

Player:

GameLauncher.class


What am I doing wrong? I read somewhere that you need to use But I'm already doing that, and the code is like this in my book (Head First Java)

Using JDK 1.6.0 update 12 btw

In other words it compiles just fine but won't run.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Which class are you executing?


Swastik
ner ieru
Greenhorn

Joined: Feb 12, 2009
Posts: 7
Thank you for replying, I was executing the GuessGame class, and figured oh yeah kinda stupid to execute the class that doesn't have a main function..

However I would like to

But I got the following error:
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
In which case there is probably a compiler error preventing the GameLauncher.class file from being created. Please check whether you have the GameLauncher.class file in you folder. Use the "dir" instruction on Windows or "ls" on Unix/Linux.
You may need to compile the GameLauncher.java file.
ner ieru
Greenhorn

Joined: Feb 12, 2009
Posts: 7
Campbell Ritchie wrote:In which case there is probably a compiler error preventing the GameLauncher.class file from being created. Please check whether you have the GameLauncher.class file in you folder. Use the "dir" instruction on Windows or "ls" on Unix/Linux.
You may need to compile the GameLauncher.java file.


That fixed my problem I thank you guys kindly, I'm amazed by how fast you guys always help out!

I'll just continue to annoy the hell out of you guys till I know enough java myself to help others

Btw is it possible to copy text from the cmd to any other application, as I'm trying to by selecting the text I want to copy and using Ctrl+c and Ctrl+v but no success
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
Which command line are you using? There are hints about copying in this FAQ. On Windows, you can click the top left icon, then you click "edit" on the drop down list, then click highlight text, mark the code with your mouse, then <enter> will copy it to the clipboard. At least I think that's how you do it; I am not on Windows at the moment.

And . . . you're welcome

[edit]It says "mark" on the command prompt menu, not highlight.[/edit]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exceptation in thread "main" java.lang.NoSuchMethodError: main