title: Find serial ports
body: <p>I have searched for code that can represent the serial ports I have on. I found this one:</p>
  
  <pre><code>Enumeration pList = CommPortIdentifier.getPortIdentifiers();
  
  // Process the list.CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("/dev/tty1");
  while (pList.hasMoreElements()) {
    CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement();
  
    System.out.print("Port " + cpi.getName() + " ");
    if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) {
      System.out.println("is a Serial Port: " + cpi);
    } else if (cpi.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
      System.out.println("is a Parallel Port: " + cpi);
    } else {
      System.out.println("is an Unknown Port: " + cpi);
    }
  }
  </code></pre>
  
  <p>but it isn't working, it seems that pList doesn't have any elements.
  Maybe my computer doesn't have any serial ports, in this case how can I check it?</p>