Compiler creates broken classfiles although errors are shown in output

Sven Reimers sven.reimers at
Mon Feb 15 16:02:00 UTC 2016

There is an example in here

Area: Tools / javac


Interfaces need to be present when compiling against their implementations


When compiling a class against another class implementing an interface
which is defined in yet another class file, such class file (where
interface is defined) must be available in the class path used
by javac during compilation. This is a new requirement as of JDK 8 - a
failure to do so will result in a compilation error.


import p1.A;

class Client {

   void test() {

       new A.m();




package p1;

public class A implements I {

   public void m() { }



package p1;

public interface I {

   void m();


If neither p1/ nor p1/I.class are available when compiling, the following error will be displayed: error: cannot access I

       new A().m();


  class file for p1.I not found

If this does not reproduce the problem, I will try to reduce our code sample



Hi Sven,

Would you have a testcase on which this can be seen?


On 15.2.2016 15:34, Sven Reimers wrote:

> Hi,
> I just ran into
> The main problem is not to fix the error,  but our continuous
> integration is not creating breaking builds,  so the error can get
> unnoticed into builds and fails at runtime.
> Any idea if this can be fixed in an upcoming jdk 8u release?
> Any idea how to make the build break in this case?
> Thanks for your help
> -Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list