Java (Eclipse) - Conditional compilation
问题 I have a java project that is referenced in j2me project and in android project. In this project i would like to use conditional compilation. Something like... //#if android ... //#endif //if j2me ... //#endif I have been reading about this but i did not find anything useful yet. 回答1: You could use Antenna (there is a plugin for Eclipse, and you can use it with the Ant build system). I'm using it in my projects in a way you've described and it works perfectly :) EDIT: here is the example