For me it was required to check if the path contained an 'include' directory. Else it would have chosen the path /usr/lib/jvm/default-java which points to a JRE without the header files.