def _java_command(command):
    """
    General wrapper that can execute java command in container with SDK
    injected java binary.

    Args:
        command (str): Command that should be executed

    Returns:
        Bash wrapped command that initializes JAVA environment for executing
        the java command.
    """
    return (
        "bash -c ' "
        "export JAVA_HOME=$(ls -d $MESOS_SANDBOX/jre*/); "
        "export JAVA_HOME=${{JAVA_HOME%/}}; "
        "export PATH=$(ls -d $JAVA_HOME/bin):$PATH; "
        "{command}"
        "'"
    ).format(command=command)