D
Dmitry
Dear friends!
I have problem with Java Communications API. I try to run simple
program to get list of serial ports.
Here is my checklist what I do:
1. have downloaded Java Communications API version 2.0 for Microsoft
Windows
2. placed comm.jar and javax.comm.properties into c:\sdk1.4.2_03\ lib
3. placed win32com.dll into c:\sdk1.4.2_03\ bin
4. setup classpath variable for c:\sdk1.4.2_03\lib\comm.jar
5. turn on my node device that is connected to PC by COM port
6. made simple program and run it:
import java.io.*;
import java.util.*;
import javax.comm.*;
public class proba implements SerialPortEventListener{
static CommPortIdentifier portId;
static Enumeration portList;
SerialPort serialPort;
public static void main(String args[]){
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
System.out.println(portId.getName());
}
}
public void serialEvent(SerialPortEvent event) {
}
}
7. expect the list of ports, but there is no one. Actually portList
has no elements at all.
8. my OS is Win2000 and I have only entry in javax.comm.properties
file Driver=com.sun.comm.Win32Driver
So give an advice please how to fix this problem. Actually I have some
questions
is Java Communications API version 2.0 is developed for win2000?
is win32com.dll driver is enough?
is entry “Driver=com.sun.comm.Win32Driver” in
javax.comm.properties file correct?
Thank you for any help.
I have problem with Java Communications API. I try to run simple
program to get list of serial ports.
Here is my checklist what I do:
1. have downloaded Java Communications API version 2.0 for Microsoft
Windows
2. placed comm.jar and javax.comm.properties into c:\sdk1.4.2_03\ lib
3. placed win32com.dll into c:\sdk1.4.2_03\ bin
4. setup classpath variable for c:\sdk1.4.2_03\lib\comm.jar
5. turn on my node device that is connected to PC by COM port
6. made simple program and run it:
import java.io.*;
import java.util.*;
import javax.comm.*;
public class proba implements SerialPortEventListener{
static CommPortIdentifier portId;
static Enumeration portList;
SerialPort serialPort;
public static void main(String args[]){
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
System.out.println(portId.getName());
}
}
public void serialEvent(SerialPortEvent event) {
}
}
7. expect the list of ports, but there is no one. Actually portList
has no elements at all.
8. my OS is Win2000 and I have only entry in javax.comm.properties
file Driver=com.sun.comm.Win32Driver
So give an advice please how to fix this problem. Actually I have some
questions
is Java Communications API version 2.0 is developed for win2000?
is win32com.dll driver is enough?
is entry “Driver=com.sun.comm.Win32Driver” in
javax.comm.properties file correct?
Thank you for any help.