def init_jvm(java_home=None,<EOL>jvm_dll=None,<EOL>jvm_maxmem=None,<EOL>jvm_classpath=None,<EOL>jvm_properties=None,<EOL>jvm_options=None,<EOL>config_file=None,<EOL>config=None):
if not config:<EOL><INDENT>config = _get_python_api_config(config_file=config_file)<EOL><DEDENT>cdll = preload_jvm_dll(jvm_dll_file=jvm_dll,<EOL>java_home_dir=java_home,<EOL>config_file=config_file,<EOL>config=config,<EOL>fail=False)<EOL>import jpy<EOL>if not jpy.has_jvm():<EOL><INDENT>jvm_options = get_jvm_options(jvm_maxmem=jvm_maxmem,<EOL>jvm_classpath=jvm_classpath,<EOL>jvm_properties=jvm_properties,<EOL>jvm_options=jvm_options,<EOL>config=config)<EOL>logger.debug('<STR_LIT>' % repr(jvm_options))<EOL>jpy.create_jvm(options=jvm_options)<EOL><DEDENT>else:<EOL><INDENT>jvm_options = None<EOL><DEDENT>return cdll, jvm_options<EOL>
Creates a configured Java virtual machine which will be used by jpy.

:param java_home: The Java JRE or JDK home directory used to search JVM shared library, if 'jvm_dll' is omitted.
:param jvm_dll: The JVM shared library file. My be inferred from 'java_home'.
:param jvm_maxmem: The JVM maximum heap space, e.g. '400M', '8G'. Refer to the java executable '-Xmx' option.
:param jvm_classpath: The JVM search paths for Java class files. Separated by colons (Unix) or semicolons
                      (Windows). Refer to the java executable '-cp' option.
:param jvm_properties: A dictionary of key -> value pairs passed to the JVM as Java system properties.
                    Refer to the java executable '-D' option.
:param jvm_options: A list of extra options for the JVM. Refer to the java executable options.
:param config_file: Extra configuration file (e.g. 'jpyconfig.py') to be loaded if 'config' parameter is omitted.
:param config: An optional default configuration object providing default attributes
               for the 'jvm_maxmem', 'jvm_classpath', 'jvm_properties', 'jvm_options' parameters.
:return: a tuple (cdll, actual_jvm_options) on success, None otherwise.