Installation on MacOS X

From Rxtx

Revision as of 18:22, 6 December 2007 by Ajmas (Talk | contribs)
Jump to: navigation, search

Installing From Source

Before you start installing RXTX you will need to make sure that XCode, Apple's development environment is installed. It should be on one of the system installation disks, or the more recent version is available from Apple's developer web site. As for Java, MacOS X already comes with Java installed so no need to install it again.

Once you have XCode installed download RXTX 2.1 (currently rxtx-2.1-7r2.zip), or if you need to be compatible with javax.comm, then download RXTX 2.0 (rxtx-2.0-7pre1.tar.gz). Note that RXTX is the version that is recommended.

Once you have downloaded the source extract it, in a terminal window navigate to the extracted directory and enter the command:

./sh configure

This will configure the build and generate the necessary make files.

Note, that there may be supplementary options you may want to configure, though the standard options should suffice. To see what they are:

./sh configure --help

Once confiugre has finished running start the make process:

make

If everything has gone to plan you should have a directory corresponding to the system's unix name, for example "powerpc-apple-darwin8.11.0", with the native library 'librxtxSerial.jnilib' and in the current directory there should be the java librar 'RXTXcomm.jar'. See the section on "installing binaries" below, on where to put things.

Installing Binaries

Whether you compiled from source, or got a binary distribution you should have two files: RXTXcomm.jar and librxtxSerial.jnilib. You will need to copy them to an appropriate location. If you want them to be available to all programs, then the standard locations are:

  • /Library/Java/Extensions - to make available to all users
  • ~/Library/Java/Extensions - to make available to only your user

Also, if you are using an IDE such as Eclipse, you can opt to include them in your project instead. If your project is MyHelloWorld then locations would be:

  • MyHelloWorld/lib/RXTXcomm.jar
  • MyHelloWorld/librxtxSerial.jnilib

Don't forget to include them in your build path.

Personal tools