Q:

How do I refer to a variable from a method in the same class

I surprisingly find this confusing.  I must be missing something. 
So I have this simple syntax
public class OMG{
    public static void main(String args[]){
        int hi=2;
        letsDoIt();
        System.out.println(hi);
    }
    public static void letsDoIt(){
        hi+=1;
    }
}

Obviously this cause an error, since hi is a local variable. 
Judging from my experience from python I added this
public class OMG{
    public static void main(String args[]){
        int hi=2;
        letsDoIt();
        System.out.println(hi);
    }
    public static void letsDoIt(){
        this.hi+=1;
    }
}

Which adds extra error when non-static variable cannot be accessed from a static method. 
I added  static  to hi
public class OMG{
    public static void main(String args[]){
        static int hi=2;
        letsDoIt();
        System.out.println(hi);
    }
    public static void letsDoIt(){
        this.hi+=1;
    }
}

The compiler scolds me for a illegal expression.  I substitute the static with private (which some SO answers, recommend) but same error. 
Where's my mistake?  Is there any way I can solve this, without making global class? 

A:

You cannot declare static variables inside a method because static modifier means that a method or field belongs to the class. 
The easiest solution to this problem would be to declare the variable as static class variable.  Using this approach, you also need to remove this from this.hi in lestDoIt method.  The code would be like this:
public class OMG {
    static int hi=2;
    public static void main(String args[]) {
        letsDoIt();
        System.out.println(hi);
    }
    public static void letsDoIt() {
        hi+=1;
    }
}

Another solution may be using a non static variable hi.  This would need you to also remove the static modifier to the letsDoIt method to access to hi field, because static methods cannot access to instance fields because, as explained above, static means that a method or field belongs to the class and not to a specific object instance of the class. 
The solution would be:
public class OMG {
    int hi=2;
    public static void main(String args[]) {
        //note that we have to create a new instance of OMG
        //because, again, static methods cannot access to non-static methods/fields
        OMG omg = new OMG();
        omg.letsDoIt();
        System.out.println(omg.hi);
    }
    public void letsDoIt() {
        this.hi+=1;
    }
}

More info:

Java Tutorials.  Using the this Keyword
Java Tutorials.  Understanding Class Members

