Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-10-2005, 03:19 AM   PM User | #1
jtrechter
New Coder

 
Join Date: Mar 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
jtrechter is an unknown quantity at this point
JAVA: "no main classes found"??

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.
jtrechter is offline   Reply With Quote
Old 05-11-2005, 01:09 AM   PM User | #2
somaiah
New to the CF scene

 
Join Date: May 2005
Location: Oslo Norway
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
somaiah is an unknown quantity at this point
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.
somaiah is offline   Reply With Quote
Old 05-11-2005, 03:03 AM   PM User | #3
jtrechter
New Coder

 
Join Date: Mar 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
jtrechter is an unknown quantity at this point
Then how do you run a servlet? Can I do it with NetBeans?
jtrechter is offline   Reply With Quote
Old 05-11-2005, 11:30 PM   PM User | #4
Punchnmylunch
New to the CF scene

 
Join Date: May 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Punchnmylunch is an unknown quantity at this point
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.
Punchnmylunch is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:21 PM.


Advertisement
Log in to turn off these ads.