You have to add the JDK path to the include path, so the compiler knows the location of the file.
Windows:
/I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32"
Linux:
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
did Settings-->Compiler and debugger-->Search directories-->and added "$(JAVA_HOME)\include" and "$(JAVA_HOME)\include\win32" under Compiler, and it was able to find it!