Communication API

i have to develop a little program for my studies which deals with the communication api.
my question: is there a possebility to find out if printer is connected to a serial port or not. any method that returns whether there is one or not...
thx in advance

Sun dropped the support on Windows' Comm-API.
You could have a look at RXTX: [http://www.rxtx.org/]

Similar Messages

  • Java communication api for windows 64 bit

    Hi,
    I need communication api for windows 64 bit. Are these api's in developement?
    Thanks,
    Andrea Todeschini

    If you use version 2.0 of the rxtx library then it provides a complete implementation of the javax.comm package.
    Version 2.1 does not (its in the gnu.io namespace)
    // Try the following url
    http://users.frii.com/jarvi/rxtx/download.html
    matfud

  • Does the Communications API work with Studio 4

    I just installed Studio 4 along with the JDK. The Java version that I am running now is:
    java version "1.4.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
    Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
    Running on MS XP.
    The Communications API seemed to work just fine on JDK 1.3 with Forte 1.0.
    I installed the Comm API as instructed and set my ClassPath:
    CLASSPATH=D:\PROGRA~1\s1studio_jdk\j2sdk1.4.1_02\lib\comm.jar;D:\MyProjects\java\GarxFace
    A call to:
    Enumeration portList;
    portList = CommPortIdentifier.getPortIdentifiers();
    does not yield any ports at all.
    Stranger yet, if I use the auto complete feature in the editor. For example if I type: m_PortID. then no members of PortID show up.
    But the code compiles just fine.
    Any idea what is going on?

    First I found the reason that the auto complete was not working. I had to mount the comm.jar file (you did not have to do this in Forte 1,0, just set the classpath). I thought that I had done that. That is the problem when you work late. ;)
    Here is a eexcerpt that I found on a search in another post:
    Copy javax.comm.properties to your <JDK>\lib directory.
    C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib
    The javax.comm.properties file must be installed. If it is not, no ports will be found by the system.
    Notice it says that "javax.comm.properties file must be installed"
    javax.comm.properties is indeed installed in my JDK lib subrirectory, but it is almost like it is not being found.

  • About Java Communication API for Windows

    hi
    I'm studying Serial Communication in university.
    I'd like to know the reason why we can't downlaod Java Communication API for Windows.
    I confirmed Comm for Linux and Soralis, but I can't find Comm for Win.
    Please tell me the reason if someone know.

    For no particular reason Sun stopped supporting the windows version
    of that package. I use rxtx which happens to allow for much faster
    communication too.
    The interface is identical to Sun's version, just the package differs: "gnu.io".
    kind regards,
    Jos

  • Problem with Java Communication API

    hi
    I installed the Java Communication API on win32 platform (as per the guidelines)
    Now when I try to run the sample program 'Blackbox' for the serial port, I get an error (in fact an exception is generated inside main function in BlackBox.class file)
    I tried the SimpleRead.java example but that too generated the same exception
    Can anybody help me out.... I am a novice with Java Comm API

    I tried running the sample BlackBox program provided for serial port and now it says
    No Serial Ports Found!
    I verified that both comm.jar and javax.comm.properties are in the <JDK>\lib directory.
    Actually, I am using netBeans IDE 1.4 and I used the C:\J2SDK folder installed with netBeans for the Java Communicaion API
    plz help.

  • Java Communications API and Java SDK 1.4.2

    I just installed the Java Communications API 2.0 on my Windows XP system, with JDK 1.4.2. As per the install instructions, I copied files from the zip into my /lib and /bin directories and set the classpath. However, when I attempt to compile any of the samples, the compiler displays a large number of errors. I know the API documentation only references JDK1.2 -- are there any special tricks to installing on newer JDKs, or will I need to acquire an older JDK to develop?

    My path variable is still not being set! Here is the content of my autoexec.bat located on the root directory of C:\
    rem - By Groove Setup
    PATH=%PATH%;"C:\Program Files\Groove Networks\Groove\Bin"
    PATH=%PATH%;C:\PROGRAM FILES\J2SDK1.4.2_07\BIN
    /code]
    When I type 'path' at the MSDOS C:\ prompt, I receive the following in the get the following:C:\WINDOWS;C:\WINDOWS\COMMAND;\C:\PROGRAM FILES\GROOVE NETWORKS\GROOVE\BIN
    As an aside, I noticed that when I perform a search of the my hard drive (c:\), I find two autoexec.bat files. One at the root, and the other in C:\Windows\Command\EBD.
    I believe the instructions stated to modify the autoexec.bat at the root directory.
    TIA for any assistance. This is really becoming a nusance and taking up quite a bit of my time trying to resolve this problem.

  • Identifying a comm port using java communication API

    HI ALL,
    i'm using the communication API to detect the comm port to which my modem is attached.
    i say CommPortIdentifier c = CommPortIdentifier.getPortIdentifier("COM3");
    then i SOP(c.getName())
    i get an exception saying noSuchPortException
    i've put the javax.comm.properties file in jdk/lib but to no avail.
    i also have a win32com.dll file that is there inside lib.
    but this hasn't helped. Now the properties file has a driver mentioned. do i have 2 download that driver or does it come with the OS (i've no idea)
    i would be helpful if anybody could help me out with this problem.

    Try putting tha javax.comm.properties file in you <java>/jre/lib folder as well... It worked for me !

  • Communication API for Linux

    I want to develop an application in Java for Linux that uses serial port .
    But java.sun.com provides communications API for Windows, Solaris but not Linux ! ! !
    Where can I find free java api to drive a serial port easily ???
    Thanks a lot

    I think you can do this using the version for Solaris/SPARC along with RXTX for Linux (do a search on google), also I think IBM did a JavaCOMM api for linux.

  • Communications  API

    To all;
    Does anybody know if Sun's, or IBM's Communications API works with Win Modems.
    Symptoms;
    Both COM1 and COM2 are disabled in the BIOS of my PC.
    My Win Modem is installed and working fine using COM1(its a PCI modem).
    From MS-DOS Prompt I key mode COM1:
    I get Illegal Device in Return.
    From My Java Program that uses Communications API, I get noSuchPortException.
    If I enable both COM1, and COM2 in the BIOS, set
    up my modem to use COM3, the DOS mode works
    for both COM1 and COM2, but not COM3.
    My Java program also finds COM1, and COM2, but
    not COM3.
    Any body have any experience with this?
    Bruce Houghton

    No luck yet???

  • Hurry! Communication API's Application?

    Hello everyone!
    I have some questions for java.lang.object and javax.comm.*.
    I have edited a serial communication program which use jb7.0e to act a serial equipment.
    That program is used java's communication API. And I do it well in my computer.
    But when I make it into application program, always has one error trouble me...:
    java.lang.NullPointerException
    at adx.SerialBean.WritePort(SerialBean.java:125)
    at adx.App1.<init>(App1.java:51)
    at adx.App1.main(App1.java:114)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.zerog.lax.LAX.launch(Unknown Source)
    at com.zerog.lax.LAX.main(Unknown Source)
    I send the SerialBean.java at the end of the message.
    Would you show me a right way.
    Waiting for your early reply!
    Yours, telerich
    2002-11-22
    SerialBean.javaimport java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class SerialBean
    static String PortName;
    CommPortIdentifier portId;
    SerialPort serialPort;
    static OutputStream out;
    static InputStream in;
    SerialBuffer SB;
    ReadSerial RT;
    public SerialBean(int PortID)
    PortName = "COM" + PortID;
    public int Initialize()
    int InitSuccess = 1;
    int InitFail = -1;
    try
    portId = CommPortIdentifier.getPortIdentifier(PortName);
    try
    serialPort = (SerialPort)
    portId.open("Serial_Communication", 2000);
    } catch (PortInUseException e)
    return InitFail;
    try
    in = serialPort.getInputStream();
    out = serialPort.getOutputStream();
    } catch (IOException e)
    return InitFail;
    try
    serialPort.setSerialPortParams(19200,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e)
    return InitFail;
    } catch (NoSuchPortException e)
    return InitFail;
    SB = new SerialBuffer();
    RT = new ReadSerial(SB, in);
    RT.start();
    return InitSuccess;
    public String ReadPort(int Length)
    String Msg;
    Msg = SB.GetMsg(Length);
    return Msg;
    public void WritePort(String Msg1)
    int c;
    try
    for (int i = 0; i < Msg1.length(); i++)
         {System.out.print(Msg1.charAt(i));
    out.write(Msg1.charAt(i));}
    } catch (IOException e) {}
    public void ClosePort()
    RT.stop();
    serialPort.close();
    }

    You do know what a NullPointerException is, right? In line 125, in the WritePort-method, you try to access a variable that is null. The way you have posted your code I can't see which line that is, so it's hard for me to say anything more, (use code tags next time) but it is probably something rather straigthforward that you have forgotten. Carefully check all variables you use in that line to see if they are really initialised.

  • Serial Communication API

    Can anyone recommened any API's that can be used to read and write to Serial ports? I have looked into Java Communication API but this is depricated and I would prefer not to use it. I have also tried RXTX but this is a little buggy.
    Any others out there? Would prefer a Windows/Linux multiplateform solution but if not just a Windows one is fine.
    Thanks,

    Yeah, I know that's what you 'should' do, but a user doesn't always do what you expect they 'should' do. So if a user does pull out the USB cable before the application is shut down and the COM port is closed, then the error appears. Isn't there a way to catch that exception?
    Best regards,
    RoDeNtJe

  • Communication API and Linux

    But... exists an implementation of Communication API for linux?

    But... exists an implementation of Communication API
    for linux?http://www.google.com/search?q=javacomm+for+linux
    First hit:
    Java Comm Serial API How-To for Linux
    http://wass.homelinux.net/howtos/Comm_How-To.shtml
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • About Java(tm) Communications API

    Hi all,
    I am customizing some project, using Java(tm) Communications API.
    I've find it is not include of J2SE core module, and had some incompatibility issue.
    I am wondering if there are other package I could use in replace of this particular API?
    Thx,
    James

    Hi all,
    I am customizing some project, using Java(tm) Communications API.
    I've find it is not include of J2SE core module, and had some incompatibility issue.
    I am wondering if there are other package I could use in replace of this particular API?
    Thx,
    James

  • Use of communications API

    Communication API is used for windows platform, with win32comm.dll file & it is working satisfactorily. But the same is not working with Novell. It asks for win32com.nlm file, where do I get it?
    How to shutdown windows 98/95 through java application?

    I don't think COMM API are supported in Novell. I think that they are only for Windows and Solarias but actually there is a port for Linux and BSD too (it is called RXTX).
    To shutdown windows 9x try this:
      Runtime.exec("rundll32 user32.dll,ExitWindowsEx");

  • Java Communications API

    Hi
    I've written a program to communicate with a circuit with JCA throught LPT Port. I have done this:
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class test65{
    static Enumeration portList;
    static CommPortIdentifier portId;
    static int num = 8;
    static ParallelPort parPort;
    static OutputStream outputStream;
    public static void main(String arg[]){
    portList = CommPortIdentifier.getPortIdentifiers();
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier) portList.nextElement();
    if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
    System.out.println ("Found Parralel Port :"+portId.getName());
    if (portId.getName().equals("LPT1")) {
    try {
    parPort = (ParallelPort)portId.open("Robotics", 2000);
    } catch (PortInUseException e) {
    System.out.println("ERROR: This port is in use by: "+e.currentOwner+".");
    try {
    outputStream = parPort.getOutputStream();
    } catch (IOException e) {
    System.out.println ("ERROR: IO Exception.");
    parPort.close();
    } catch (NullPointerException e){
    System.out.println ("ERROR: OutPutStream could not be Created.");
    parPort.close();
    try {
    System.out.println ("Number "+num+" is about to be sent ....");
    System.out.println ("Mode : "+parPort.getMode());
    outputStream.write(num); //(1)
    System.out.println ("Number "+num+" was Sent.");
    } catch (IOException e) {
    System.out.println ("ERROR: Could not Write Output");
    parPort.close();
    in the line that writes num to the stream,(1), program stops and doesn't send anything. If i install a printer then the num is sent to the printer driver to be PRINTED. i don't want to print anything. I've think if there is any driver that sends to the port whatever it recieves. What should i do to send numbers to LPT port like outp and out commands in basic and c ?

    When using java communications api you need to simulate a centronics printer circuit in order to get output to the pins all this requires is that you pull pin11 (Busy) low, pin12 (Paper Out) low, and pin15 (Printer Error) High, although I've only had success thus far using spp mode which of course only supports output. Good luck all.

Maybe you are looking for

  • What accessories were used in the iphone video recorded in January 2014

    I am trying to learn what "extras" were used in the making of the Apple video of 24 January 2014.  Credits indicate extra accessories were used.  I would like to learn what they were.

  • Trouble inserting padding in webpage

    I built a site in Flash and pulled it into Dreamweaver, gave it a background and pushed it down from the top.  What I want to do is center it in the middle of the page but I can't seem to do it.  I have some options in the "Align" box such as, Top, M

  • Printing Date Book without "list" format - Palm TX

    I have an old Palm TX and am trying to print a day just as it shows in my Palm software-with all the times down the left hand side of the screen.  But everytime I print, it just prints it in "list format".  Is there any way to print other than in "li

  • Problems with autofill when editing address book entries

    When i try to change eg miller to Miller, anna to Anna etc 1) the initial letter remains lower case and 2) even worse, another iller/nna is added on to the end - milleriller, annanna etc. I've tried deleting the whole name and starting again - no joy

  • IChat is showing a communication error when ever i try to video chat.

    Hey all, if someone can give me a little help on this. I have read other topics similar to this problem but the solutions didnt seem to work. I have a NETGEAR router and here is my error message: Date/Time: 2008-01-12 20:34:21.150 -0500 OS Version: 1