code: public static boolean isRserveRunning() {
          try {
              RConnection c = new RConnection();
              Log.Out.println("Rserve is running.");
              c.close();
              return true;
          } catch (Exception e) {
              Log.Err.println("First connect try failed with: " + e.getMessage());
          }
          return false;
      }
docs: check whether Rserve is currently running (on local machine and default
  port).
  
  @return <code>true</code> if local Rserve instance is running,
  <code>false</code> otherwise