Installation on Linux

From Rxtx

(Difference between revisions)
Jump to: navigation, search
(Requirements)
(Installing from Source)
Line 7: Line 7:
== Installing from Source ==
== Installing from Source ==
 +
=== Installing Java ===
-
==== Quick Install ====
+
If you don't already have Java installed on your system, you will need to install it. The best way, if possible, is to use the package manager for your distribution to install it. Failing that you can get a JDK (Java Developer Kit) installer from Sun's [http://java.sun.com/javase/downloads Java Developer web site]. For people only be running Java applications, then you can get the [http://java.com/en/download/linux_manual.jsp JRE installation], though note that you will not be able to develop or compile with this version. Since the general instructions are oriented towards developers we recommend having the JDK installed.
-
The following packages are used to build rxtx:
+
If the environment variable JAVA_HOME is not defined, then it is recommend that you define it in your login script. For example if you java installation is located at /usr/java/jdk6_03, then in a csh style shell:
-
autoconf-2.59
+
setenv JAVA_HOME /usr/java/jdk6_03
-
automake-1.9.5
+
-
libtool-1.5.18
+
-
gnu make-3.79.1        On some systems like FreeBSD this is
+
-
called gmake
+
-
jdk 1.3 or newer
+
-
With the packages installed, proceed to build and install rxtx.
+
or an sh style shell:
-
<pre>
+
  JAVA_HOME /usr/java/jdk6_03
-
$ tar -xzvf rxtx-2.1.tar.gz
+
export JAVA_HOME
-
$ cd rxtx-2.1
+
-
$ ./configure (follow the instructions)
+
-
$ make install (gmake if your system uses that convention)
+
-
Read "R.  How can I use Lock Files with rxtx?"
+
-
</pre>
+
-
One catch that has showed up... you cannot have spaces in the path.
+
-
for instance:  /home/jarvi/test build/rxtx/... will cause problems.
+
-
                                  ----^
+
-
If that does not work or you do not want a script messing with the
+
-
system, read on..
+
 +
=== Installing RXTX ===
-
==== Add RXTXcomm.jar to your CLASSPATH. ====
+
Once you have downloaded the source extract it, and then in a terminal window navigate to the extracted directory and type the command:
-
jdk-1.1:
+
./sh configure
-
make sure /usr/local/java/lib/RXTXcomm.jar is in your
+
This will configure the build and generate the necessary make files.  
-
CLASSPATH.  If you want to use apps that require
+
-
RXTXcomm.jar.
+
-
in bash:
+
Note, that there may be supplementary options you may want to configure, though the standard options should suffice. To see what they are:
-
$ export CLASSPATH=${CLASSPATH}:/usr/local/java/lib/RXTXcomm.jar:.
+
./sh configure --help
-
jdk-1.2 and newer:
+
Once configure has finished running start the make process:
-
No changes are needed.
+
make
-
==== Build and Install the jar. ====
+
{| style="background-color: #ffffcc"
 +
| '''Note:''' Spaces in the path may cause the build to fail. If it does ensure the path does not have any spaces.
 +
|}
-
configure      configure supports build directories.
+
Once done you can now install it. You either do this as root user, or by using sudo:
-
configure requires javac in its path or
+
-
JAVA_HOME set to grab some java system
+
-
properties.
+
-
make    to build RXTXcomm.jar and the libraries
+
-
make install to place the jar and libraries in the correct
+
-
location
+
-
You may select the JDK you wish to build with using $JAVA_HOME
+
sudo make install
-
For example:
+
-
export JAVA_HOME=/usr/local/java
+
-
Otherwise, configure grabs the JDK from your PATH.
+
-
==== Where did everything end up? ====
+
RXTX should now be installed. See the [[development]] section for some example code to get you running.
-
 
+
-
Lets assume the top java directory is /usr/local/java
+
-
 
+
-
jdk-1.2 the files go in
+
-
<pre>
+
-
/usr/local/java/jre/lib/ext/RXTXcomm.jar
+
-
/usr/local/java/jre/lib/$(ARCH)/librxtxSerial.so.
+
-
/usr/local/java/jre/lib/$(ARCH)/librxtxParallel.so.
+
-
/usr/local/java/jre/lib/$(ARCH)/lib/...
+
-
 
+
-
jdk-1.1.* the files go in
+
-
 
+
-
/usr/local/java/lib/RXTXcomm.jar
+
-
/usr/lib/librxtxSerial.so.
+
-
/usr/lib/librxtxParallel.so.
+
-
/usr/lib/...
+
-
 
+
-
The librxtxSerial.so librxtxParallel.so are placed in
+
-
/usr/lib so people don't have to change with their
+
-
LD_LIBRARY_PATH.
+
-
</pre>
+
== Installing Binaries ==
== Installing Binaries ==
To do...
To do...

Revision as of 18:37, 6 December 2007

The documentation below is a little dated and could do with some updating. Please could someone reformat and ensure their correctness:

Contents

Requirements

You will need JDK 1.4+, autoconf, automake, libtool, gnu make and gcc.

Installing from Source

Installing Java

If you don't already have Java installed on your system, you will need to install it. The best way, if possible, is to use the package manager for your distribution to install it. Failing that you can get a JDK (Java Developer Kit) installer from Sun's Java Developer web site. For people only be running Java applications, then you can get the JRE installation, though note that you will not be able to develop or compile with this version. Since the general instructions are oriented towards developers we recommend having the JDK installed.

If the environment variable JAVA_HOME is not defined, then it is recommend that you define it in your login script. For example if you java installation is located at /usr/java/jdk6_03, then in a csh style shell:

setenv JAVA_HOME /usr/java/jdk6_03

or an sh style shell:

JAVA_HOME /usr/java/jdk6_03
export JAVA_HOME

Installing RXTX

Once you have downloaded the source extract it, and then in a terminal window navigate to the extracted directory and type 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 configure has finished running start the make process:

make
Note: Spaces in the path may cause the build to fail. If it does ensure the path does not have any spaces.

Once done you can now install it. You either do this as root user, or by using sudo:

sudo make install

RXTX should now be installed. See the development section for some example code to get you running.

Installing Binaries

To do...

Personal tools