Hi there,
Try this:
ports = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")
hi,everyone:
Recently ,i found a strange problem.
I wrote a java file to print all the port on the command line. The source code i attached below:
import java.util.*;import java.io.*;import javax.comm.*;
public class listenraw { public static void main(String argv[]) { new listenraw()