views:

587

answers:

2

I've already followed the directions @ http://stackoverflow.com/questions/1383277/using-preprocessor-directives-in-blackberry-jde-plugin-for-eclipse for making sure the blackberry plugin preprocessing hook is (theoretically) enabled.

I'm using Eclipse 3.5.1 with Blackberry Plugin 1.1 with BB SDKs 4.7.0 and 4.6.0.

I have my preprocessor defines set (and I've tried in both the Project's Blackberry Properties as well as the Workspace Blackberry Build settings), and checked their capitalization and spelling carefully too.

I'm fairly confident the actual code to say "this stuff should be preprocessed" is good, because including/excluding preprocessed code seems to work fine on command line builds:

//#preprocess --- at beginning of file

and then code blocks like this throughout:

//#ifndef jde_4_7
  /*
//#endif   
//#ifdef jde_4_7
import net.rim.device.api.ui.TouchEvent;
//#endif
//#ifndef jde_4_7
  */
//#endif   

So what I can't figure out what else could be wrong that would cause Eclipse to not compile in my preprocessed code unless I remove the comments that are supposed to prevent the touch code from building into a build for blackberries that don't support touch.

At one point it used to work (and no I haven't updated Eclipse), but sometime in the last couple of weeks it seemed to just stop working. And I'm getting kind of tired of the error-prone process of searching for ifdefs and manually commenting/uncommenting touch code and looking for a better solution while I do testing and initial development requiring testing both touch and non-touch functionality.

Any other ideas on what could be wrong or how to fix it?

A: 

Yeah, I've had the same experience with this. Seems like they've dropped support for it with their new plug-in. Sometimes it feels like those guys can't get anything right. If you want preprocessing I'm afraid you'll have to use Eclipse 3.4 and the old plug-in (1.0.67). You can go here and fetch a bundled eclipse 3.4 with the said plug-in and any other component pack you may need.

Orr Matarasso
The funny thing is, using the preprocessor with the newest versions of Eclipse and plugins working just fine a week ago... which leads me to suspect an unintended configuration or code change is causing it not to work vs. trying to do something that is impossible or a known bug. There is nothing I could find related to the specific issue I'm facing in the lengthy 1.1 JDE plugin's list of known issues (http://docs.blackberry.com/en/developers/deliverables/11984/BlackBerry_Java_Plug-in_for_Eclipse-Release_Notes--955931-1110035757-001-1.1-US.pdf).
Jessica
Well, if you do manage to get it working (again) with eclipse 3.5 and the 1.1 plug-in please post the answer because this is the only reason I'm still using the old environment.
Orr Matarasso
+2  A: 

I managed to get this working by adding this in the eclipse ini file

osgi.framework.extensions=net.rim.ejde.preprocessing.hook

you would probably already have osgi.framework.extensions. Just add net.rim.ejde.preprocessing.hook to it.

Prashast
Apologies if I wasn't clear enough in my original question, when I originally asked it was specifically because the solution in the stack overflow question I linked to (which was to do exactly as you say) wasn't sufficient to get the preprocessor revived.
Jessica