diff options
Diffstat (limited to 'docs/programmer_reference/java.html')
| -rw-r--r-- | docs/programmer_reference/java.html | 148 |
1 files changed, 89 insertions, 59 deletions
diff --git a/docs/programmer_reference/java.html b/docs/programmer_reference/java.html index b14e40db..b154d4c9 100644 --- a/docs/programmer_reference/java.html +++ b/docs/programmer_reference/java.html @@ -14,13 +14,11 @@ <body> <div xmlns="" class="navheader"> <div class="libver"> - <p>Library Version 11.2.5.3</p> + <p>Library Version 12.1.6.1</p> </div> <table width="100%" summary="Navigation header"> <tr> - <th colspan="3" align="center">Chapter 5. - Java API - </th> + <th colspan="3" align="center">Chapter 5. Java API </th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="am_misc_faq.html">Prev</a> </td> @@ -34,9 +32,7 @@ <div class="titlepage"> <div> <div> - <h2 class="title"><a id="java"></a>Chapter 5. - Java API - </h2> + <h2 class="title"><a id="java"></a>Chapter 5. Java API </h2> </div> </div> </div> @@ -75,18 +71,24 @@ </div> </div> </div> - <p>Building the Berkeley DB java classes, the examples and the native support -library is integrated into the normal build process. See -<a href="../installation/build_unix_conf.html" class="olink">Configuring Berkeley DB</a> and <a href="../installation/build_win_java.html" class="olink">Building the Java API</a> in the Berkeley DB Installation and Build Guide -for more information.</p> - <p>We expect that you already installed the Java JDK or equivalent on your -system. For the sake of discussion, we assume that it is in a directory -called db-VERSION; for example, you downloaded a Berkeley DB archive, and you -did not change the top-level directory name. The files related to Java -are in three subdirectories of db-VERSION: java (the java source files), -libdb_java (the C++ files that provide the "glue" between java and -Berkeley DB) and examples_java (containing all examples code). The directory -tree looks like this:</p> + <p> + Building the Berkeley DB java classes, the examples and the + native support library is integrated into the normal build + process. See <a href="../installation/build_unix_conf.html" class="olink">Configuring Berkeley DB</a> and <a href="../installation/build_win_java.html" class="olink">Building the Java API</a> in the + Berkeley DB Installation and Build Guide for more information. + </p> + <p> + We expect that you already installed the Java JDK or + equivalent on your system. For the sake of discussion, we + assume that it is in a directory called db-VERSION; for + example, you downloaded a Berkeley DB archive, and you did not + change the top-level directory name. The files related to Java + are in three subdirectories of db-VERSION: java (the java + source files), libdb_java (the C++ files that provide the + "glue" between java and Berkeley DB) and examples/java + (containing all examples code). The directory tree looks like + this: + </p> <pre class="programlisting">db-VERSION |-- java | `-- src @@ -103,55 +105,83 @@ tree looks like this:</p> `-- libdb_java `-- ... </pre> - <p>This naming conforms to the de facto standard for naming java packages. -When the java code is built, it is placed into two jar files: -<code class="filename">db.jar</code>, containing the db package, -and <code class="filename">dbexamples.jar</code>, containing the examples.</p> - <p>For your application to use Berkeley DB successfully, you must set your -<code class="literal">CLASSPATH</code> environment variable to include the full pathname of -the db jar files as well as the classes in your java distribution. -On UNIX, <code class="literal">CLASSPATH</code> is a colon-separated -list of directories and jar files; -on Windows, it is separated by semicolons. -On UNIX, the jar files are put in your build directory, and when -you do the make install step, they are copied to the lib directory -of your installation tree. On Windows, the jar files are placed -in the Release or Debug subdirectory with your other objects.</p> - <p>The Berkeley DB Java classes are mostly implemented in native -methods. Before you can use them, you need to make sure that the -DLL or shared library containing the native methods can be found -by your Java runtime. On Windows, you should set your PATH variable -to include:</p> + <p> + This naming conforms to the de facto standard for naming + java packages. When the java code is built, it is placed into + two jar files: <code class="filename">db.jar</code>, containing the db + package, and <code class="filename">dbexamples.jar</code>, containing + the examples. + </p> + <p> + For your application to use Berkeley DB successfully, you + must set your <code class="literal">CLASSPATH</code> environment + variable to include the full pathname of the db jar files as + well as the classes in your java distribution. On UNIX, + <code class="literal">CLASSPATH</code> is a colon-separated list of + directories and jar files; on Windows, it is separated by + semicolons. On UNIX, the jar files are put in your build + directory, and when you do the make install step, they are + copied to the lib directory of your installation tree. On + Windows, the jar files are placed in the Release or Debug + subdirectory with your other objects. + </p> + <p> + The Berkeley DB Java classes are mostly implemented in + native methods. Before you can use them, you need to make sure + that the DLL or shared library containing the native methods + can be found by your Java runtime. On Windows, you should set + your PATH variable to include: + </p> <pre class="programlisting"> <code class="filename">db-VERSION\build_windows\Release</code> </pre> - <p>On UNIX, you should set the -<code class="literal">LD_LIBRARY_PATH</code> environment variable or local equivalent -to include the Berkeley DB library installation directory. Of course, the -standard install directory may have been changed for your site; see your -system administrator for details.</p> - <p>On other platforms, the path can be set on the command line as follows -(assuming the shared library is in <code class="filename">/usr/local/BerkeleyDB/lib</code>:)</p> + <p> + On UNIX, you should set the + <code class="literal">LD_LIBRARY_PATH</code> environment variable or + local equivalent to include the Berkeley DB library + installation directory. Of course, the standard install + directory may have been changed for your site; see your system + administrator for details. + </p> + <p> + On other platforms, the path can be set on the command line + as follows (assuming the shared library is in + <code class="filename">/usr/local/BerkeleyDB/lib</code>:) + </p> <pre class="programlisting">% java -Djava.library.path=/usr/local/BerkeleyDB/lib ...</pre> - <p>Regardless, if you get the following exception when you run, you -probably do not have the library search path configured correctly:</p> + <p> + Regardless, if you get the following exception when you run, + you probably do not have the library search path configured + correctly: + </p> <pre class="programlisting">java.lang.UnsatisfiedLinkError</pre> - <p>Different Java interpreters provide different error messages if the -<code class="literal">CLASSPATH</code> value is incorrect, a typical error is the following:</p> + <p> + Different Java interpreters provide different error messages + if the <code class="literal">CLASSPATH</code> value is incorrect, a + typical error is the following: + </p> <pre class="programlisting">java.lang.NoClassDefFoundError</pre> - <p>To ensure that everything is running correctly, you may want to try a -simple test from the example programs in</p> + <p> + To ensure that everything is running correctly, you may want + to try a simple test from the example programs in + </p> <pre class="programlisting"> - <code class="filename">db-VERSION/examples_java/src/db</code> + <code class="filename">db-VERSION/examples/java/src/db</code> </pre> - <p>For example, the following sample program will prompt for text input -lines, which are then stored in a Btree database named <code class="filename">access.db</code> in -your current directory:</p> + <p> + For example, the following sample program will prompt for + text input lines, which are then stored in a Btree database + named <code class="filename">access.db</code> in your current + directory: + </p> <pre class="programlisting">% java db.AccessExample</pre> - <p>Try giving it a few lines of input text and then end-of-file. Before -it exits, you should see a list of the lines you entered display with -data items. This is a simple check to make sure the fundamental -configuration is working correctly.</p> + <p> + Try giving it a few lines of input text and then + end-of-file. Before it exits, you should see a list of the + lines you entered display with data items. This is a simple + check to make sure the fundamental configuration is working + correctly. + </p> </div> </div> <div class="navfooter"> |
