Specifying preprocessor directives

You can specify preprocessor directives that are used to preprocess your Java® source files before they are passed to the Java compiler. You can specify preprocessor directives for a single project or for all projects in a workspace. You must turn on preprocessing in Eclipse before you can specify preprocessor directives. For more information about how to turn on preprocessing, see the BlackBerry Java Plug-in Installation and Configuration Guide .

Directive

Description

//#preprocess

This directive specifies that a file must be preprocessed. This directive must be the first line in a .java file.

//#ifdef tag ... #else ... #endif

This directive specifies that the block before the else is compiled if tag is specified. Otherwise, only the block after the else is compiled.

//#ifndef tag ... #else ... #endif

This directive specifies that the block before the else is compiled if tag is not specified. Otherwise, only the block after the else is compiled.

If you have not turned on preprocessing, before you specify preprocessor directives you are prompted to restart Eclipse.


Was this information helpful? Send us your comments.