Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Communications API, help to start!

Thread Tools

Java Communications API, help to start!

Posts: n/a
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
2. placed comm.jar and 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.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();
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
file Driver=com.sun.comm.Win32Driver

So give an advice please how to fix this problem. Actually I have some
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 file correct?

Thank you for any help.
Reply With Quote
Damian P.
Posts: n/a

1. win32com.dll put to c:\sdk1.4.2_03\jre\bin
2. put to c:\sdk1.4.2_03\jre\lib
3. comm.jar put to c:\sdk1.4.2_03\jre\lib\ext


Reply With Quote
Dale King
Posts: n/a
"Damian P." <(E-Mail Removed)> wrote in message
news:c0achp$dbi$(E-Mail Removed)...
> Hi,
> 1. win32com.dll put to c:\sdk1.4.2_03\jre\bin
> 2. put to c:\sdk1.4.2_03\jre\lib
> 3. comm.jar put to c:\sdk1.4.2_03\jre\lib\ext

And probably you need to also put them in the same places under C:\Program
Files\Java\j2re1.4.2_03, because most likely that is the JRE you are using
for running the code. The JRE in the SDK directory is the one you used for
compiling it.
Dale King

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use java to write a tcp OR udp program which can implement communications between two hosts in a Lan? entrepreneur Java 11 01-01-2007 08:25 PM
Data Dropouts with Communications API - Help! Thomas M. Alldread Java 7 12-21-2005 01:18 AM
Generic communications module with a little help from classes... Python 0 06-30-2005 06:37 PM
Java Parallel Port Programming with the Java Communications API Paul Perrone Java 0 08-21-2003 03:45 PM
Help with client/server communications RCarter Java 2 08-08-2003 11:08 AM