title: Java, non-static cannot be reference to static context
body: <p>Doing Java course, at UNI atm, and I'm having a bit of trouble with a dice-problem.</p>
  
  <p>I have the following:</p>
  
  <pre><code> public class Die {
     public int eyes;
     private java.util.Random r;
     private int n;
  
     public Die (int n) {
       r = new Random();
       this.n = n;
     }
  
     public void roll() {
       eyes = r.nextInt(Die.n);
     }
  </code></pre>
  
  <p>When compiling I get: non-static variable n cannot be referenced from a static context. How would I go about fixing this, whilst having it randomize from a user given value?</p>