PDA

View Full Version : JAVA: "no main classes found"??


jtrechter
05-10-2005, 04:19 AM
I received a complete existing java game. All I have to do is compile and run it. It compiles fine, but every time I try to run it, it says "No main classes found". I tried running it from command prompt and with NetBeans. Same problem. The file is too long to post here, but there is a main function thats commented out and one comment line says:
"Can't run as an application since it use sound-related methods"
I'm not sure what to do. Now I'm wondering if I need to compile since there are already a .class file for each .java file. Any ideas? Thanks.

somaiah
05-11-2005, 02:09 AM
Without knowing more about the code, I'm guessing this game needs to be run as a servlet or something like that, and thats why the main fn is commented out.

jtrechter
05-11-2005, 04:03 AM
Then how do you run a servlet? Can I do it with NetBeans?

Punchnmylunch
05-12-2005, 12:30 AM
Well for your main class thats your public class is it the same as your title of the program saved to? like lets say

it needs to be applet not an application. so check that as well.

but...

import java.awt.*;
import java.applet.*;

public final class Game extends applet
{

}

check and see if "Game" is the title of your program.