error cannot find symbol

Hi friends I'm getting this error

C:\jdk1.5.0\bin>javac SimpleWrite.java

SimpleWrite.java:22: cannot find symbol

symbol : method openPort(java.lang.String,int)

location: class javax.comm.CommPortIdentifier

portId.openPort("SimpleWriteApp", 2000);

^

1 error

can u plz help me to cure it as javax.comm api is new to me.

[377 byte] By [dextroa] at [2007-10-3 4:18:45]
# 1
would help if you posted some of the accompaning code...
xzyfera at 2007-7-14 22:20:30 > top of Java-index,Archived Forums,Socket Programming...
# 2

The accompanying code is as follows

import java.io.*;

import java.util.*;

import javax.comm.*;

public class SimpleWrite {

static Enumeration portList;

static CommPortIdentifier portId;

static String messageString = "Hello, world!\n";

static SerialPort serialPort;

static OutputStream outputStream;

public static void main(String[] args) {

portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {

portId = (CommPortIdentifier) portList.nextElement();

if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {

// if (portId.getName().equals("COM1")) {

if (portId.getName().equals("/dev/term/a")) {

try {

serialPort = (SerialPort)

portId.openPort("SimpleWriteApp", 2000);

} catch (PortInUseException e) {}

try {

outputStream = serialPort.getOutputStream();

} catch (IOException e) {}

try {

serialPort.setSerialPortParams(9600,

SerialPort.DATABITS_8,

SerialPort.STOPBITS_1,

SerialPort.PARITY_NONE);

} catch (UnsupportedCommOperationException e) {}

try {

outputStream.write(messageString.getBytes());

} catch (IOException e) {}

}

}

}

}

}

plz help....

dextroa at 2007-7-14 22:20:30 > top of Java-index,Archived Forums,Socket Programming...
# 3
I agree with the compiler. There is no such method. Check the API.
ejpa at 2007-7-14 22:20:30 > top of Java-index,Archived Forums,Socket Programming...