Comm não acha portas

Estou com problemas com o pacote comm, tipo ele não acha nenhuma porta, alguém sabe me dizer oq eh?

public static void main(String[] args) { int i = 0; Enumeration listaDePortas; listaDePortas = CommPortIdentifier.getPortIdentifiers(); String portas[] = new String[10]; while (listaDePortas.hasMoreElements()) { CommPortIdentifier ips = (CommPortIdentifier)listaDePortas.nextElement(); portas[i] = ips.getName(); i++; } for(int l=0; l < portas.length; l++){ System.out.print(portas[l] + ": " + l + (char)10); } }

retorno:

null: 0
null: 1
null: 2
null: 3
null: 4
null: 5
null: 6
null: 7
null: 8
null: 9

e ta tudo instaladinho certinho minhas portas e drivers, COM1, COM2 e LPT1…

alguém tem idéia do que se passa??

Abracetas… :wink:

Você verificou se está setando certo?

Faz assim:

[code]public static void main(String[] args) {
int i = 0;
Enumeration listaDePortas;
listaDePortas = CommPortIdentifier.getPortIdentifiers();
String portas[] = new String[10];
while (listaDePortas.hasMoreElements()) {
CommPortIdentifier ips = (CommPortIdentifier)listaDePortas.nextElement();
portas[i] = ips.getName();

// teste
System.out.println(i + ". " + portas[i] + " - " + ips.getName());
// teste

     i++; 
  } 
  for(int l=0; l < portas.length; l++){ 
     System.out.print(portas[l] + ": " + l + (char)10); 
  } 

}[/code]

Ou se você estiver usando uma IDE e souber como fazer para consultar… do it.