Page 241 - The Ultimate Palm Robot
P. 241

Color profile: Generic CMYK printer profile
           Composite  Default screen
                                                      Bots / The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8






                    224     The Ultimate Palm Robot



                    Getting the Java Communications API

                               As we wrote at the beginning of this chapter, we’re assuming that you already
                               know how to program. For this section, we’re also assuming that you know
                               how to program in Java, and that you already have a Java Software Develop-
                               ment Kit (SDK). So we won’t be showing you how to get a Java SDK or how to
                               program in Java. We’ll simply say that you need one of the Java 2 versions of
                               the SDK (we recommend the 1.4 version) to program for the BrainStem.
                                 However, as we mentioned earlier, you do need to have a special Java library
                               to communicate over the serial port to the BrainStem. This library is the Java
                               Communications API. You can download the Java Communications API at
                               http://java.sun.com/products/javacomm/. At the time we wrote this, Sun
                               provided support only for Windows and Solaris platforms. There is third-
                               party support for Linux; see the FAQ at the Java Communications API web
                               page for a link to the Linux version.
                                 Download and unzip the API to your computer. When you unpack the archive
                               to your computer, it will create a \commapi directory. So we recommend you
                               unpack the archive to your Java SDK directory. For example, if your SDK is
                               installed at C:\jdk1.4, you would unpack the API so that the API files are installed
                               at C:\jdk1.4\commapi.
                                 The installation instructions for the API are contained in a file named
                               PlatformSpecific.html that is included with the installation. We’ll briefly repeat
                               the Windows directions here:

                                   1. Copy win32com.dll to the \bin directory of your Java installation.
                                   2. Copy comm.jar to the \lib directory of your Java installation.
                                   3. Copy javax.comm.properties to the \lib directory of your Java
                                      installation.
                                   4. Add comm.jar to your classpath.

                                  And here are the directions for Solaris:

                                   1. Add libSolarisSerialParallel.so to the environment LD_LIBRARY_
                                      PATH. Alternately, copy libSolarisSerialParallel.so to /usr/lib.
                                   2. Copy comm.jar to the /lib directory of your Java installation.












           P:\010Comp\Bots\880-6\ch08.vp
           Monday, May 12, 2003 1:16:47 PM
   236   237   238   239   240   241   242   243   244   245   246