def write_config_files(out_dir='<STR_LIT:.>',<EOL>java_home_dir=None,<EOL>jvm_dll_file=None,<EOL>install_dir=None,<EOL>req_java_api_conf=True,<EOL>req_py_api_conf=True):
import datetime<EOL>retcode = <NUM_LIT:0><EOL>tool_name = os.path.basename(__file__)<EOL>py_api_config_basename = '<STR_LIT>'<EOL>java_api_config_basename = '<STR_LIT>'<EOL>if not jvm_dll_file:<EOL><INDENT>jvm_dll_file = find_jvm_dll_file(java_home_dir=java_home_dir)<EOL><DEDENT>if jvm_dll_file:<EOL><INDENT>py_api_config_file = os.path.join(out_dir, py_api_config_basename)<EOL>try:<EOL><INDENT>with open(py_api_config_file, '<STR_LIT:w>') as f:<EOL><INDENT>f.write("<STR_LIT>" % (tool_name, str(datetime.datetime.now())))<EOL>f.write(<EOL>"<STR_LIT>")<EOL>if java_home_dir:<EOL><INDENT>f.write('<STR_LIT>' % repr(java_home_dir))<EOL><DEDENT>f.write('<STR_LIT>' % repr(jvm_dll_file))<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL><DEDENT>logger.info("<STR_LIT>" % py_api_config_file)<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception("<STR_LIT>")<EOL>if req_py_api_conf:<EOL><INDENT>retcode = <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>logger.error("<STR_LIT>")<EOL>if req_py_api_conf:<EOL><INDENT>retcode = <NUM_LIT:2><EOL><DEDENT><DEDENT>try:<EOL><INDENT>java_api_config_file = os.path.join(out_dir, java_api_config_basename)<EOL>java_api_properties = _get_java_api_properties(fail=req_java_api_conf, path=install_dir)<EOL>java_api_properties.store(java_api_config_file, comments=[<EOL>"<STR_LIT>" % (tool_name, str(datetime.datetime.now())),<EOL>"<STR_LIT>"])<EOL>logger.info("<STR_LIT>" % java_api_config_file)<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception("<STR_LIT>")<EOL>if req_java_api_conf:<EOL><INDENT>retcode = <NUM_LIT:3><EOL><DEDENT><DEDENT>return retcode<EOL>
Writes the jpy configuration files for Java and/or Python.

:param out_dir: output directory, must exist
:param java_home_dir: optional home directory of the Java JRE or JDK installation
:param jvm_dll_file: optional file to JVM shared library file
:param install_dir: optional path to where to searfh for modules
:param req_java_api_conf: whether to write the jpy configuration file 'jpyconfig.properties' for Java
:param req_py_api_conf: whether to write the jpy configuration file 'jpyconfig.py' for Python
:return: zero on success, otherwise an error code