code: def create_java_executor(self, dist=None):
      
      dist = dist or self.dist
      if self.execution_strategy == self.NAILGUN:
        classpath = os.pathsep.join(self.tool_classpath('nailgun-server'))
        return NailgunExecutor(self._identity,
                               self._executor_workdir,
                               classpath,
                               dist,
                               startup_timeout=self.get_options().nailgun_subprocess_startup_timeout,
                               connect_timeout=self.get_options().nailgun_timeout_seconds,
                               connect_attempts=self.get_options().nailgun_connect_attempts)
      else:
        return SubprocessExecutor(dist)
docs: Create java executor that uses this task's ng daemon, if allowed.
  
      Call only in execute() or later. TODO: Enforce this.