Search code examples
javaantjava-mepreprocessormtj

Does anyone know how succesfully use preprocessing on J2ME?


I'll try to better explain my problem. Using Eclipse and MTJ (Mobile Tools for Java) plugin you can set some directives for the preprocessor in order to create different builds of your code, like in C/C++. My problem is that i'm unable to use this feature. I mean, when i build my sources, the resulting output contains every line of code, even ones contained within

//#mdebug info
...
//#enddebug

directive. I have "Enable preprocessing" option checked and i've changed the debug level to every possible setup (lower, equals and higher than "info") and the result is always the same: the directives are simply ignored.


Solution

  • Found it! It was a configuration issue, my mistake. Still there is a problem with MTJ plugin itself: when you export the build.xml file to feed Ant, whatever debug level you have selected on the dropdown menu, it will always end in writing "info" on the output, so I have to change it manually. I'll try to ask directly the developers of the plugin.