allow old CMake builds to find JNI headers
fix build warnings