omero.java module

java.check_java(command)[source]
java.cmd(args, java='java', xargs=None, chdir=None, debug=None, debug_string='-Xrunjdwp:server=y,transport=dt_socket,address=8787,suspend=n')[source]

Defines the command to be used by run or popen.

java.makeVar(key, env)[source]
java.popen(args, java='java', xargs=None, chdir=None, debug=None, debug_string='-Xrunjdwp:server=y,transport=dt_socket,address=8787,suspend=n', stdout=-1, stderr=-1)[source]

Creates a subprocess.Popen object and returns it. Uses cmd() internally to create the Java command to be executed. This is the same logic as run(use_exec=False) but the Popen is returned rather than the stdout.

java.run(args, use_exec=False, java='java', xargs=None, chdir=None, debug=None, debug_string='-Xrunjdwp:server=y,transport=dt_socket,address=8787,suspend=n', stdout=-1, stderr=-1)[source]

Execute a Java process, either via subprocess waiting for the process to finish and returning the output or if use_exec is True, via os.execvpe with the current environment.

-X style arguments for the Java process can be set either via the xargs argument or if unset, the JAVA_OPTS environment variable will be checked. Note: shlex.split() is called on the JAVA_OPTS value and so bash-style escaping can be used to protect whitespaces.

Debugging can more simply be turned on by passing True for the debug argument. If more control over the debugging configuration is needed, pass debug_string.