I'm using javax.comm package on my m/c. and try to execute the following prob, but it won't giving an error "Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver"
Here is the prog.
wts wrong with the code or any suggestions ?import java.lang.Enum; import java.util.Enumeration; import javax.comm.*; //import javax.print.attribute.standard.MediaSize.Other; public class ListPort { public static void main(String args[]) { Enumeration port_list = CommPortIdentifier.getPortIdentifiers(); try { while (port_list.hasMoreElements()) { CommPortIdentifier port_id = (CommPortIdentifier) port_list.nextElement(); if (port_id.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println("Serial port: " + port_id.getName()); } else if (port_id.getPortType() == CommPortIdentifier.PORT_PARALLEL) { System.out.println("Parallel port: " + port_id.getName()); } else { System.out.println("Other port: " + port_id.getName()); } } } catch (Exception e) { System.out.println("Error : " + e.getMessage()); } } // main } // class ListPort
Thanks