docs: def _get_java_env(self):
          "Set env vars from connection if set"
          env = super(_DistributedSubmitter, self)._get_java_env()
          if self._streams_connection is not None:
              # Need to sure the environment matches the connection.
              sc = self._streams_connection
              if isinstance(sc._delegator, streamsx.rest_primitives._StreamsRestDelegator):
                   env.pop('STREAMS_DOMAIN_ID', None)
                   env.pop('STREAMS_INSTANCE_ID', None)
              else:
                   env['STREAMS_DOMAIN_ID'] = sc.get_domains()[0].id
              if not ConfigParams.SERVICE_DEFINITION in self._config():
                  env['STREAMS_REST_URL'] = sc.resource_url
                  env['STREAMS_USERNAME'] = sc.session.auth[0]
                  env['STREAMS_PASSWORD'] = sc.session.auth[1]
          return env