Q:

IntelliJ code for specific project

I am writing a cross platform game in IntelliJ IDEA using Java and I have run into a situation where I can't seem to find this feature which Visual Studio had:

This feature allowed me to have a condition, (2 lines of code), for example #if keyword1/#endif, and the code between those 2 lines, compiled only when the current project had keyword1 declared as compilation symbol through the project settings.
Is there any similar feature in IntelliJ IDEA ?

A:

This is a preprocessor symbol, nothing IDE-dependant. There are some workarounds for this in java. For example you could use something like this:
public static final boolean DEBUG = false;

public void someMethod(){
    if(DEBUG)
        dosomething();
    else
        dosomethingElse();
}

Most precompilers will optimize this such that the result won't contain the if-else statement and reduce this to a simple call to dosomethingElse. But there's no preprocessor/precompiler statement like in c++ for java.

