title: Unchecked exception when using static imports, how come?
body: <p>I'm experiencing some strange behavior when using static imports of inherited static methods:</p>
  <p>com/example/util/BaseUtil.java:</p>
  <pre><code>package com.example.util;
  
  /*default*/ class BaseUtil {
      public static final void foo(){ System.out.println(&quot;foo&quot;); }
  }
  </code></pre>
  <p>com/example/util/Util.java:</p>
  <pre><code>package com.example.util;
  
  public final class Util extends BaseUtil{
      public static void bar(){ System.out.println(&quot;bar&quot;); }
      //foo() will be inherited
  }
  </code></pre>
  <p>com/example/UtilTest.java</p>
  <pre><code>package com.example;
  
  import static com.example.util.Util.bar;
  import static com.example.util.Util.foo;
  
  public class UtilTest {
      public static void main(String[] args) {
          bar();
          foo();
      }
  }
  </code></pre>
  <p>Running <code>UtilTest</code> result in an unchecked exception!</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.lang.IllegalAccessError: tried to access class com.example.util.BaseUtil from class com.example.UtilTest</p>
  <pre><code>    at com.example.UtilTest.main(UtilTest.java:15)
  </code></pre>
  </blockquote>
  <p>However, if I were to reference the methods via <code>Util</code> (without static imports) everything works as expected:</p>
  <p>com/example/UtilTest.java</p>
  <pre><code>package com.example;
  
  import com.example.util.Util;
  
  public class UtilTest {
      public static void main(String[] args) {
          Util.bar();
          Util.foo();
      }
  }
  </code></pre>
  <p>So, what gives?</p>