Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / JAVA / libjafs / JAFS_README
CommitLineData
805e021f
CE
1Java API for OpenAFS (Jafs) README
2Current as of 6/5/02
3
4 ##########################################################################
5 # Copyright (c) 2001-2002 International Business Machines Corp. #
6 # All rights reserved. #
7 # #
8 # This software has been released under the terms of the IBM Public #
9 # License. For details, see the LICENSE file in the top-level source #
10 # directory or online at http://www.openafs.org/dl/license10.html #
11 # #
12 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
13 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
14 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #
15 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR #
16 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
17 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
18 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
19 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
20 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
21 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
23 ##########################################################################
24
25*** INTRODUCTION ***
26
27Jafs is an open source API designed to allow Java programmers the ability
28to create applications for the administration or use of OpenAFS file systems.
29It works by accessing libadmin and libuafs (administrative and user-level
30libraries that come with OpenAFS) through JNI. It consists of a Java package
31called org.openafs.jafs, and a shared libraries libjafsadm.so and libjafs.so.
32
33*** USE ***
34
35There is a version of Jafs that has been compiled on Red Hat Linux 7.1,
36and can be directly used without compilation. It was compiled using
37OpenAFS 1.2.4 libraries (with a modified version of libjuafs.a). It
38consists of a JAR file (jafs.jar) and two shared libraries
39(libjafsadm.so and libjafs.so). It was compiled using the
40--enable-transarc-paths on compilation (for use with the OpenAFS RPMs),
41gcc 2.96, and Java Classic VM version 1.4.0.
42
43When you write Java code to use this API, import the
44org.openafs.jafs package. During compilation of your Java code,
45ensure one of the following conditions are met:
46 - Use the "-classpath" option to javac to specify the jafs.jar file.
47 - Change your $CLASSPATH environment variable to include the
48 jafs.jar file (e.g. export CLASSPATH=$CLASSPATH:jafs.jar
49
50When running an application that uses Jafs, the shared libraries
51need to be found by Java's library loader. The easiest way to
52accomplish this is to copy these files into the /usr/lib/ directory,
53or create symbolic links from that directory to the files. Alternatively,
54the directory containing the libraries can also be added to the
55LD_LIBRARY_PATH environment variable, instead.
56
57You also need to have an OpenAFS client set up on your machine
58(preferably version 1.2.4, but it should work for some past versions as well).
59You can obtain the OpenAFS client and view installation documentation at
60http://www.openafs.org (the RPMs are easiest to use for Linux). Also any
61cells you plan to access through the API must have entries in your
62client's CellServDB file (located in the /usr/vice/etc/ directory in most
63setups).
64
65This API is most effective when used with a cell that uses the kaserver
66for authentication. It does not currently support alternative methods of
67authentication such as Kerberos V.
68
69If you have successfully set up your Linux 7.1 environment as described
70above, you will be able to develop and execute applications that use
71the Jafs API.
72
73*** BUILD ***
74
75The first step in compiling your own versions of the library and jar file
76is to download the OpenAFS source code.
77
78From that same directory, run the configure script as you normally would
79to compile OpenAFS, but run it with a java_home argument so the script can
80find your java distribution. For example:
81
82 ./configure [other options] --java_home=/usr/local/jdk
83
84The configure script will ensure that this directory contains bin/ and lib/
85subdirectories, and that there are /bin/javac and/bin/javah executables and
86an include/jni.h file. If you don't supply a command line argument for the
87java home, the script will look for it in environment variables: first in
88$JAVA_HOME and then in $JDK_HOME. Also, note that if you have installed
89(or are planning to install) OpenAFS by using the RPMs for Linux, you
90should provide the --enable-transarc-paths configuration option. If you
91get a "** Can't determine local cell name" error message, the most likely
92reason is that you didn't supply this option.
93
94Next, do a full build of OpenAFS by executing a make in the current
95directory. After it finishes, you are ready to compile Jafs. Execute
96'make jafs' from that same directory. Afterward, there will be
97libjafsadm.so and libjafs.so in the lib/ directory, and a jafs.jar in the
98jlib/ directory. These can be used according to the instructions in the
99'USE' section of this document.
100
101If you'd like to edit the source code, you'll find the native C code in
102the src/libjafs directory, and the Java code in the
103src/JAVA/org/openafs/jafs/ directory. Please reference the
104src/TechNotes-JavaAPI document for more information.
105