java.lang.Error: Unresolved compilation problem: The method main cannot be declared static; static methods can only be declared in a static or top level type

Coderanch | Moe Kennedy | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Simple Chat Problem

    Coderanch | 6 years ago | Moe Kennedy
    java.lang.Error: Unresolved compilation problem: The method main cannot be declared static; static methods can only be declared in a static or top level type

    Root Cause Analysis

    1. java.lang.Error

      Unresolved compilation problem: The method main cannot be declared static; static methods can only be declared in a static or top level type

      at server.SimpleChatServer$ClientHandler.main()
    2. server
      SimpleChatServer$ClientHandler.main
      1. server.SimpleChatServer$ClientHandler.main(SimpleChatServer.java:40)
      1 frame