Results 1 to 2 of 2
  1. #1
    mathias is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Error: Can't run as an application since it use sound-related methods

    Hi, 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 that's 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. #2
    baltimore is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    Well for your main class that's 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...
    Java Code:
    import java.awt.*;
    import java.applet.*;
    
    public final class Game extends applet
    {
    
    }
    check and see if "Game" is the title of your program.

Similar Threads

  1. Replies: 5
    Last Post: 08-26-2009, 12:59 PM
  2. Math Related Problem
    By perito in forum Advanced Java
    Replies: 1
    Last Post: 03-21-2008, 09:53 AM
  3. Issue related to browser
    By sachindanayak in forum Java Servlet
    Replies: 0
    Last Post: 02-03-2008, 03:25 AM
  4. Make sound play in a java application
    By lenny in forum AWT / Swing
    Replies: 2
    Last Post: 08-13-2007, 12:45 PM
  5. MMAPI sound application
    By luisarca in forum CLDC and MIDP
    Replies: 0
    Last Post: 06-18-2007, 07:34 PM

Posting Permissions

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