java.lang.RuntimeException: Uncompilable source code - non-static method getConnection() cannot be referenced from a static context

Coderanch | sahar eb | 4 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

    defining a non static method or class inside main?

    Coderanch | 4 years ago | sahar eb
    java.lang.RuntimeException: Uncompilable source code - non-static method getConnection() cannot be referenced from a static context

    Root Cause Analysis

    1. java.lang.RuntimeException

      Uncompilable source code - non-static method getConnection() cannot be referenced from a static context

      at com.mycompany.sitemap.App.main()
    2. com.mycompany.sitemap
      App.main
      1. com.mycompany.sitemap.App.main(App.java:12)
      1 frame