1

I am using Java 8 and eclipse Kepler IDE for my development. I have Interface define in my project with the following default method:

public default Consumer getRetailCustomer(List<Consumer> consumers) {
        for (Consumer cons : consumers) {
            if(cons.getType.equals("Retail"))
                return cons;
            }     
        } 

I try to debug this method, I put the break point on for condition but bedug is not able to go inside default method.

Let me know how can I debug default method of Interface in Java 8 using Eclipse IDE?

Ankush soni
  • 1,439
  • 1
  • 15
  • 30
  • You can debug it like any other method. Maybe the class implemented `getRetailCustomer` itself. – a better oliver Jul 31 '15 at 07:20
  • No, my class doesn't have any implementation. – Ankush soni Jul 31 '15 at 07:25
  • 2
    Kepler doesn't provide support for Java 8. That shouldn't be a problem if you have installed the appropriate patch, but maybe you need a newer version of the patch or even have to upgrade to Luna or Mars. Other than that there's nothing special you have to do in Eclipse to be able to debug default methods. – a better oliver Jul 31 '15 at 09:37
  • The problem is that even the JVM’s debug interface [hasn’t catched up until recently](http://stackoverflow.com/a/30038411/2711488) so Eclipse’s debugger had no chance to support it before that. Obviously, you need a debugger newer than the added support… – Holger Jul 31 '15 at 09:50

1 Answers1

0

Either you user Mars which supports Java 8 , Or you can add kepler plugin support for Java 8

https://marketplace.eclipse.org/content/java-8-support-eclipse-kepler-sr2

Kumar Abhishek
  • 3,004
  • 33
  • 29
  • I have same problem for Eclipse Oxygen (4.7). Break points in default methods are skipped. – cane Aug 27 '18 at 11:31