def get_java_include()

in setup.py [0:0]


def get_java_include():
    inc_name = 'include'
    if is_apple_jdk():
        inc_name = 'Headers'
    inc = os.path.join(get_java_home(), inc_name)
    if not os.path.exists(inc):
        print("Include folder should be at '{0}' but doesn't exist. "
              "Please check you've installed the JDK properly.".format(inc),
              file=sys.stderr)
        sys.exit(-1)
    jni = os.path.join(inc, "jni.h")
    if not os.path.exists(jni):
        print("jni.h should be in '{0}' but doesn't exist. "
              "Please check you've installed the JDK properly.".format(jni),
              file=sys.stderr)
        sys.exit(-1)

    paths = [inc]

    # Include platform specific headers if found
    include_linux = os.path.join(inc, 'linux')
    if os.path.exists(include_linux):
        paths.append(include_linux)

    include_darwin = os.path.join(inc, 'darwin')
    if os.path.exists(include_darwin):
        paths.append(include_darwin)

    include_bsd = os.path.join(inc, 'freebsd')
    if os.path.exists(include_bsd):
        paths.append(include_bsd)

    include_win32 = os.path.join(inc, 'win32')
    if os.path.exists(include_win32):
        paths.append(include_win32)
    return paths