File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
ner ieru
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which class are you executing?
 
ner ieru
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic