def find_jvm_dll_file(java_home_dir=None, fail=False):
logger.debug("<STR_LIT>")<EOL>if java_home_dir:<EOL><INDENT>jvm_dll_path = _find_jvm_dll_file(java_home_dir)<EOL>if jvm_dll_path:<EOL><INDENT>return jvm_dll_path<EOL><DEDENT><DEDENT>jvm_dll_path = os.environ.get('<STR_LIT>', None)<EOL>if jvm_dll_path:<EOL><INDENT>return jvm_dll_path<EOL><DEDENT>for name in JRE_HOME_VARS:<EOL><INDENT>java_home_dir = os.environ.get(name, None)<EOL>if java_home_dir:<EOL><INDENT>jvm_dll_path = _find_jvm_dll_file(java_home_dir)<EOL>if jvm_dll_path:<EOL><INDENT>return jvm_dll_path<EOL><DEDENT><DEDENT><DEDENT>jvm_dll_path = ctypes.util.find_library(JVM_LIB_NAME)<EOL>if jvm_dll_path:<EOL><INDENT>logger.debug("<STR_LIT>" % repr(jvm_dll_path))<EOL><DEDENT>elif fail:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>return jvm_dll_path<EOL>
Try to detect the JVM's shared library file.
:param java_home_dir: The Java JRE or JDK installation directory to be used for searching.
:return: pathname if found, else None