I use javax.print.PrintService to look up printer services on local machine. Here is code to get printers:
PrintService[] services = PrintServiceLookup.lookupPrintServices(DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
Can i also get port name of printer (USB001, COM, LPT..) in java?