The error is thrown when you have a static method and in the body of that method
you try to access a non-static class
variable:
public static void main(String[] args){
myVar = new MyVar();
}
private myVar;
This should cause the same error. It is fixed by changing the last line to:
private static myVar;