Compiler Error J0251

Unexpected EOF while looking for #endif

The compiler detected a #if conditional compilation directive but did not find a matching #endif directive, and the symbol used by the #if directive was not defined. This error usually occurs when a #if conditional compilation directive is used but a matching #endif directive was not defined to close the conditional compilation block. Ensure that you have a matching #endif directive for the #if directive specified in the error and compile again.

The following example illustrates this error:

public class Simple{
   void method1(){
      #if DEBUG //debug has not been defined
         System.out.println("Do something here");
   //error: '#endif' not specified for the '#if' directive
   }
}