title: Eclipse does not allow access to static interface method in external jar from another workspace
body: <ul>
  <li>There are two eclipse workspaces, <em>Workspace A</em> and <em>Workspace B</em>.</li>
  <li><p>In <em>Workspace A</em>, there is a project with an interface defining a public static method:</p>
  
  <pre><code>package workspacea;
  
  public interface Foo {
  
    public static String sayHello() {
      return "Hello, world!";
    }
  }
  </code></pre></li>
  <li><p>I then exported the entire project from <em>Workspace A</em> to a *.jar-File, using Export → Java → JAR file and default settings.</p></li>
  <li><p>In <em>Workspace B</em>, a class should access the static method previously defined:</p>
  
  <pre><code>package workspaceb;
  
  import workspacea.Foo;
  
  public class Bar {
  
    public static void test() {
      String msg = Foo.sayHello();
    }
  }
  </code></pre></li>
  <li><p>The previously exported *.jar from <em>Workspace A</em> is added to the Java Build Path using Project Properties → Java Build Path → Libraries → Add External JARs...</p></li>
  </ul>
  
  <p>After following these steps, the line <code>Foo.sayHello();</code> <strong>does not compile</strong>:</p>
  
  <pre><code>Unresolved compilation problem: 
  This static method of interface Foo can only be accessed as Foo.sayHello
  </code></pre>
  
  <p>From my understanding, it should compile (it recognizes the <code>Foo</code> interface perfectly fine). The funny thing is that it <strong>compiles fine if both projects are located in the same workspace</strong> (still using the *.jar library and not a project dependency).</p>
  
  <p>Eclipse offers a quick-fix, which has no effect (at least not on the code). </p>
  
  <p><a href="https://i.stack.imgur.com/pkAG2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pkAG2.png" alt="Eclipse quick-fix tool-tip"></a></p>
  
  <p><strong>What is happening here? Why does the code not compile?</strong> Is this an Eclipse bug? If so, is there a fix for it?</p>
  
  <p>I am using Luna Service Release 2 (4.4.2) Build 20150219-0600 and used Java 8 in <em>Workspace A</em>, Java 7 in <em>Workspace B</em>.</p>
  
  <p>Additional note: I can only reproduce this by using an <code>interface</code>. Using an <code>abstract class</code> and the same method works.</p>