JavaTM Communications API Implementation
for SCO® UNIX® Operating Systems,
These are the Release Notes for an implementation of the JavaTM Communications API (also known as javax.comm) for SCO® UNIX® Operating Systems. This API allows Java applications to communicate with serial and parallel devices.
The Java Communications API is described at http://java.sun.com/products/javacomm/.
This implementation is available for the following SCO UNIX operating systems:
A prerequisite is that Java 2 Standard Edition v. 1.3 or greater for SCO UNIX Operating Systems must already have been installed. This requirement may be met by any of the following Java for SCO UNIX releases:
This implementation is a port of the open source RXTX implementation of the Java Communications API. Information about RXTX may be found at http://www.rxtx.org. This port has been done off of RXTX version 1.4-8.
RXTX includes part of the Sun MicrosystemsTM
Java Communications API implementation
for Solaris/x86, version 2.0. This part (the
in this distribution; you do not need to download it from the
SunTM web page.
To install this beta implementation, place the
package file somewhere. Go there, become root, and then do:
# pkgadd -d 'pwd`/javaxcomm.ds
This will install package javaxcomm, which places the following substantive files into the J2SE for SCO UNIX directory structure:
/usr/java/jre/lib/ext/comm.jar /usr/java/jre/lib/ext/jcl.jar /usr/java/jre/lib/ext/gnu.io.rxtx.properties /usr/java/jre/lib/x86at/libSerial.so /usr/java/jre/lib/x86at/libParallel.so /usr/java/jre/lib/javax.comm.properties /usr/java/javax.comm-ReleaseNotes.html /usr/java/javax.comm-ReleaseNotes.txt
This also places a couple of license files in
and a number of demonstration and example files under
The installed binaries of the Java Communications API package are used for all SCO UNIX platforms. (On SCO OpenServer, the native code libraries are executed via the OSRcompat binary compatibility module, just as the native code layers of J2SE are.)
Note that if you install a new version of J2SE for SCO UNIX
(for example, if you go from J2SE 1.3.1 to J2SE 1.4.2),
you will have to re-install the
This is because the previously installed
actually reside within (for example)
/usr/java having been a symbolic link to that),
and thus are not visible to the new J2SE within
/usr/java now being a symbolic link to this).
javaxcomm package first; just
it a second time, and then it will be available for use with
both J2SE 1.3.1 and J2SE 1.4.2 for SCO UNIX.
To use this implementation of Java Communications API, just compile and
run Java as you normally would. Because the above files are installed
into the standard extension space of J2SE for SCO UNIX,
there is no need to set
variables in order to access the Java Communications API.
A simple test of the serial I/O part of this implementation can be done as follows. Set up a null modem RS-232 cable between two machines. Become root. Run the open source minicom tool on each machine and verify that the connection is working, by typing characters back and forth between the two machines.
(Binary versions of minicom
are installed into
Note that you need to first do
minicom -s to tell it about the names and speeds of your
When you then run
ctrl-A E and
ctrl-A A commands to
turn on local echo and linefeed add.
http://minicom.alioth.debian.org/ for more information on minicom.)
Once working serial communication has been verified, shut down minicom
on the machine that Java Communications API is installed on.
Then access the Sun SerialDemo demo program, which installed at
Change into that
SerialDemo directory, and run
# /usr/java/bin/java SerialDemo
This should bring up a GUI. Change the serial device port name and speed in the GUI if necessary, then click "Open Port". Type into the top pane and text should appear in the minicom window on the other machine. Type into the minicom window on the other machine and text should appear in the middle pane of the SerialDemo GUI. Click "Close Port" to finish.
If you do not have access to a graphical environment, you can run
the even simpler Sun demo programs installed at
/usr/java/demo/comm/Simple/, which work at the command-line
Additional sample programs using the Java Communications API are available as part of the Sun Solaris/x86 implementation and can be downloaded from http://java.sun.com/products/javacomm/.
A simple test of parallel I/O part of this implementation can be done as follows. Connect a parallel printer and define it to the system in the usual fashion as a local printer. Then obtain the Sun ParallelBlackBox demo program, which is available from Sun as one of the sample programs just mentioned above. Run it as
# /usr/java/bin/java ParallelBlackBox
This should bring up a GUI, and it will usually find the correct parallel port. Type into the top pane and text will start printing out at the printer. You may need to eject the page yourself depending upon the printer.
On SCO OpenServer, there are several kinds of serial ports.
supports both modem control (e.g.
/dev/tta1A) and standard
/dev/tty1a) operations on serial ports,
as well as use of USB-serial ports
On all SCO UNIX platforms, certain serial ports are predefined and are known to the implementation. These are:
These ports are scanned when javax.comm is started up, and those
that represent working serial ports on the system will be
included in the list returned by the
This predefined list may be overridden by specifying the property
Set the property to a colon-separated list of ports that should
be scanned for inclusion. This may be done via the command
line when Java is invoked:
To do it on a more global basis, modify the file# /usr/java/bin/java -Dgnu.io.rxtx.SerialPorts=/dev/ttya01a:/dev/ttya02a SerialDemo
/usr/java/jre/lib/ext/gnu.io.rxtx.properties, and uncomment and change the definition of the property there.
Note that the
gnu.io.rxtx.SerialPorts property, if used,
replaces the predefined list of ports; it does not augment it.
Thus, if your system has four serial ports on the predefined list
and four extra ones not on the list, you need to name all eight when
specifying the property.
During the scanning of ports, this implementation will put out trace messages to the standard output indicating its progress. These will help you troubleshoot any difficulties in this area.
This implementation uses the standard UNIX "lock file" protocols to protect
serial ports from concurrent access. This means that javax.comm will
not be able to access the port if it is already locked by another
serial application (whether javax.comm, a non-Java application such
as minicom, or a system command such as
cu), and vice versa.
In particular, on
SCO OpenServer, the lock files are of the form
/usr/spool/uucp/LCK..tty?a, where the
device name portion is folded to lowercase.
On UnixWare 7 the lock files are of the form
/var/spool/locks/LK.x.y.z, where x, y, and z are the major device
number of the device directory, the major device number of the device,
and the minor device number of the device.
For all operating systems, the lock file is created to hold the
process-id, application name (javax.comm), and username.
On all SCO UNIX platforms, certain parallel ports are also predefined and are known to the implementation. These are:
This predefined list may be overridden by specifying the property
gnu.io.rxtx.ParallelPorts, similarly to the serial case
PortInUseExceptionexception object. If you call the
getMessagemethod for that object, you will get a message containing the phrase "Port currently owned by unknown Solaris Application". (This message comes out of the Sun
comm.jarbinary implementation code and by license cannot be modified by SCO.) You may want to intercept this message in your application and change the text; see for example the change made to
SerialConnection.javain the installed SerialDemo application.
java -Xts10 ...).
ParallelPortclass that are not supported in this implementation. These are:
getOutputBufferFree isPaperOut isPrinterBusy isPrinterError isPrinterSelected isPrinterTimedOut notifyOnBuffer notifyOnError restart suspend setInputBufferSize getInputBufferSize setOutputBufferSize getOutputBufferSize. In addition sending events based on the parallel port device status is not implemented yet. For all of these methods, a dummy version is in place which will issue a diagnostic to the terminal when they are called (for some frequently-called methods, this message will only appear once) and then execution will proceed. The dummy
is*methods will return false, and the
get*methods will return a low value such as zero or one.
The license for the part of the Sun Microsystems Java Communications API implementation for Solaris/x86, version 2.0 used in this implementation is available here. It provides for binary redistribution of the implementation; no source is provided by Sun or SCO.
The license for the open source RXTX project that is used as the base
for this implementation is the
GNU Library General Public License (LGPL), available
Source for the version of RXTX used and for the modifications that
SCO made to it is not included in the
but is available from the SCO ftp site at
The RXTX source base has advanced beyond the 1.4-8 version that this product is derived from. The SCO UNIX-specific changes there were made for this product have been given back to the RXTX project and have been incorporated into the more recent source versions. However at this time none of those more recent versions is operational on SCO UNIX platforms.
Copyright © 2004 The SCO Group, Inc. All Rights Reserved.
SCO, SCO OpenServer, and UnixWare are trademarks or registered trademarks of The SCO Group, Inc. in the U.S.A. and other countries.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries, and are used under license. UNIX is a registered trademark of The Open Group in the United States and other countries.
The SCO Group, Inc. reserves the right to change or modify any of the product or service specifications or features described herein without notice. This document is for information only. No express or implied representations or warranties are made in this document.