Not compile code blocks when publishing?

Posted by Menno Gouw on Stack Overflow See other posts from Stack Overflow or by Menno Gouw
Published on 2014-08-23T13:19:05Z Indexed on 2014/08/23 16:21 UTC
Read the original article Hit count: 207

Filed under:
|

I have many lines i just use for debugging and helpers. Is there a way i can mark these so they do not compile when publishing a project but still can use when running/debugging my program within Eclipse? Even better would be to mark a certain field as debug only and discard everything that has to do with that field completely when publishing.

I understand this might get one in trouble when using fields like that and using that in critical parts of the code. But i often find myself initializing a lot of debug fields then comment them out which results in errors down the line if i do not comment those out as well.

So is there some way to handle this in a better and more efficient way?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse