# Java: getting Eclipse to work with preprocessor

This topic is 5391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

This kind of preprocessor: #ifdef #define something #endif Eclipse has those wiggly red lines over those kinds of lines. How do I keep Eclipse from doing that while checking other syntax errors like misspelled variables? I'm willing to use a preprocessor that can have it's directives placed inside some form of Java comment, if one is available. I'm also willing to switch to another full featured editor (preferrably free). So... what should I do? Thanks.

##### Share on other sites
Hey,

This sounds like a job for Antenna.

The preprocessor that comes with antenna doesnt integrate with Eclipse but allows you to hide your preprocessor directives behind the comments

//#ifdef DEBUGSystem.out.println("this will only be displayed if DEBUG is defined!");//#endif

Ontop of needing antenna you will also need ant. Remember the preprocessor doesnt integrate into eclipse, but the nice comments allow for the IDE to skip over them and just read them as comments.

##### Share on other sites
Quote:
 Original post by kooktroopThis sounds like a job for Antenna.

I'm curious on how you're setting up Eclipse. Are you using Antenna to do the entire build process thus removing Eclipse's builder, or are you using the preprocessor with Eclipse's builder?

##### Share on other sites
Quote:
 Original post by kooktroopOntop of needing antenna you will also need ant.

Ant is already intergrated into Eclipse in any of the standard Eclipse builds. [grin]

##### Share on other sites
I dont use ANT with Eclipse but thats because i use some of the ant tasks that arent supported by eclipse (at least the version i have). I'm sure if i spent the time i could set it up to work but ive got other things to do.

At the moment i just run ant from the command line. I find it better this way anyhow. All i have to do is type ant and press enter, rather than a series of clicks with the mouse.

• 21
• 13
• 9
• 17
• 13