java.lang.Error: Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

Coderanch | Paul Yule | 8 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

    Static mmbers

    Coderanch | 8 years ago | Paul Yule
    java.lang.Error: Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

    Root Cause Analysis

    1. java.lang.Error

      Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

      at tests.StaticTest.main()
    2. tests
      StaticTest.main
      1. tests.StaticTest.main(StaticTest.java:6)
      1 frame