Skip to main content

improve javax.comm

7 replies [Last post]
Joined: 2003-11-08

Java needs a new javaComm API with enhancement for the existing serial port support and addition of bluetooth, usb, firewire, and the possibility to extend it to other media. In addition, since this API is old, support for NIO should be added.
I think all this will be needed sooner or later if Java should make a come-back on the desktop and so Sun should prepare and invest on this API.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-07-16

I agree completely. This is an important API for many uses. Unfortunately the Java world doesn't seem to put much attention on this "low level" hardware I/O stuff.

Joined: 2003-07-12

[me too reply]

I'm trying to use the comm. stuff to write code for CNC/DNC computer controlled machining. Good APIs here would help (not that I have done a lot with Java Comm, but I don't like the fact that it's not part of J2SE and that I need to install native code to get it to work.) Seems to me that the capability to talk to standard PC ports (USB, parallel, serial, firewire?) should be part of desktop Java.

Joined: 2004-11-18

In College, I had to write a Java program that would receive input from a scale, and then do statistical analysis and generate some charts. I needed to use But I could not believe that it did not come as a standard feature in J2SE. I mean, shouldn’t a language that is supposed to be one of the best languages for desktop development, support serial and parallel communication as default? Not to mention that to date there is no USB support either. On unsigned types, I strongly believe that primitive unsigned types should be kept outside of Java, to avoid programming mistakes, but it would be very reasonable to ad wrapper types for them, I mean, as there are java.lang.Integer and java.lang.Short, there could be java.lang.UInteger and java.lang.UShort, and rely on this classes to do conversions and bit masking.

Joined: 2005-07-15

JavaComm is one of Sun's unloved children. It just got the absolute minimum maintenance over the years. It has serious design errors which haven't been corrected, and probably will never be corrected. E.g. the dreaded properties file, which makes it impossible to install JavaComm via WebStart, because WebStart can't move that file into the required location, but JavaComm again and again check the existence of the file.

In addition, the documentation is bad, starting with incomplete and confusing installation instructions (not suitable for an end-user), and no architecture description at all.

Sun had more than five years (or was it seven) to fix JavaComm. Sun didn't care.

Joined: 2005-06-16

In J2ME (MIDP2, JSR-118), the Generic Connection Framework (GCF) includes a which provides a simple interface to serial ports. Unfortunately CommConnection isn't in JSR-197 (GCF for J2SE) and JSR-197 isn't in the list of JSRs to be included in Mustang.

Joined: 2004-10-13

Out of general curiosity, would USB (and javax.comm) support benefit from support of unsigned types? A few of us discussed it in another thread ( )

It's possible to work without unsigned types, but as Java communicates with more devices, devs are going to need simpler ways of exchanging unsigned data with those devices. The two times I've run into this issue, I was working in someone else's protocol. Both instances were resolvable through much bitmasking and up-conversion (uchar -> short, ushort->long, etc.), but direct support for unsigned variables would have greatly simplified that effort.

I don't think this is something Java needs right now, but there will be increasing pressure to address this in the future.

Joined: 2005-04-21

USB support is in process: