title: Cannot use member variable inside onEnable()
body: <p>I have a public class and within that class I have:</p>
  
  <pre><code>Msg msg = new Msg();
  </code></pre>
  
  <p>But I can't access <code>msg</code> from the <code>public void</code> methods of the class.</p>
  
  <p>It works if I:</p>
  
  <ul>
  <li>Put <code>Msg msg = new Msg();</code> before <code>msg</code> every time I use it.</li>
  <li>Do <code>new Msg().log("")</code> instead.</li>
  </ul>
  
  <p>It doesn't work if I try:</p>
  
  <pre><code>private static Msg msg = new Msg();
  </code></pre>
  
  
  
  <pre><code>public static Msg msg = new Msg();
  </code></pre>
  
  <p>The error I am getting in console is:</p>
  
  <pre class="lang-none prettyprint-override"><code>java.lang.NoClassDefFoundError: enji/lep/Msg at enji.lep.chat.Chat.&lt;init&gt;(Chat.java:16)
  </code></pre>
  
  <p>Relevant code follows:</p>
  
  <pre><code>import java.util.logging.Logger;
  
  import org.bukkit.plugin.java.JavaPlugin;
  
  /* Created by enji */
  
  public class Chat extends JavaPlugin {
  
      Logger log = Logger.getLogger("Minecraft");
      Msg msg = new Msg();
  
      @Override
      public void onEnable() {
          msg.log("Talliban bajs i simskolans sovrum!!!!"); // This causes the error
      }
  
      @Override
      public void onDisable() {
          log.info("Plugin off");
      }
  
  }
  </code></pre>