Results 1 to 2 of 2
  1. #1
    alladin is offline Member
    Join Date
    Jan 2012
    Posts
    11
    Rep Power
    0

    Default Netbeans doesn't trace "main" file

    When i try to run th following program after build succeed i got
    the messsage:

    project EchoServer does not have a main class set


    <no main classes found>


    the program:
    --------------------
    /*
    *
    *
    * To change the template for this generated file go to
    * Window - Preferences - Java - Code Generation - Code and Comments
    */
    package echoserver;
    import java.net.*;
    import java.io.*;


    public class EchoServer {

    public static void main(String[] args) throws IOException {
    // Init server socket
    ServerSocket serverSocket = null;
    boolean stillListening = true;
    try {
    serverSocket = new ServerSocket(12333);
    }
    catch ( IOException ex ) {
    System.err.println ( " Failed to listen on port 12333");
    System.exit(1);
    }
    System.out.println(" Server is ready");

    // Init client socket and loop on accepting connections
    Socket socket = null;
    while (stillListening) {
    try {
    socket = serverSocket.accept();
    // new EchoThread(socket).start();
    }
    catch ( IOException ex ) {
    System.err.println ( " Failed to accept connection");
    System.exit(1);
    }
    }
    serverSocket.close();
    }
    }


    ------------------------------------------
    I have opened the project under:
    java application , project name: EchoServer and i canceled Create Main Class and then Finish
    What can be the problem please answer me using the Netbeans
    Attached Files Attached Files
    Last edited by alladin; 01-31-2012 at 09:16 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

    Default Re: Netbeans doesn't trace "main" file

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 5
    Last Post: 12-21-2011, 07:44 PM
  2. Replies: 11
    Last Post: 08-18-2011, 11:54 PM
  3. Replies: 4
    Last Post: 11-06-2010, 12:50 AM
  4. Replies: 5
    Last Post: 06-22-2010, 04:51 PM
  5. Replies: 1
    Last Post: 01-21-2010, 10:20 AM

Posting Permissions

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