Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New to the CF scene
    Join Date
    May 2005
    Location
    Oslo Norway
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Then how do you run a servlet? Can I do it with NetBeans?

  • #4
    New to the CF scene
    Join Date
    May 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •