Compiler Error J0249

#else without matching #if

The compiler detected a #else conditional compilation directive but, did not detect a matching #if directive. This error usually occurs because an extra #else directive was supplied. This error can also occur when a #if conditional compilation directive was deleted or commented out but a #else directive was not deleted. Ensure that you have matching directives and compile again.

The following example illustrates this error:

public class Simple{
   public void method1(){
      //do something here
      #else /*error: this '#else' directive has no matching '#if'
              directive */
   }
}