Java Communications API, help to start!

Discussion in 'Java' started by Dmitry, Feb 10, 2004.

  1. Dmitry

    Dmitry Guest

    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.
     
    Dmitry, Feb 10, 2004
    #1
    1. Advertising

  2. Dmitry

    Damian P. Guest

    Hi,

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

    Regards
    Damian
     
    Damian P., Feb 10, 2004
    #2
    1. Advertising

  3. Dmitry

    Dale King Guest

    "Damian P." <> wrote in message
    news:c0achp$dbi$...
    > Hi,
    >
    > 1. win32com.dll put to c:\sdk1.4.2_03\jre\bin
    > 2. javax.comm.properties 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
     
    Dale King, Feb 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RCarter
    Replies:
    2
    Views:
    384
  2. Paul Perrone
    Replies:
    0
    Views:
    14,434
    Paul Perrone
    Aug 21, 2003
  3. Thomas M. Alldread

    Data Dropouts with Communications API - Help!

    Thomas M. Alldread, Dec 19, 2005, in forum: Java
    Replies:
    7
    Views:
    652
    Roedy Green
    Dec 21, 2005
  4. Replies:
    0
    Views:
    315
  5. entrepreneur
    Replies:
    11
    Views:
    510
    Luc The Perverse
    Jan 1, 2007
Loading...

Share This Page