<h2class="title"style="clear: both"><aid="build_win_java"></a>Building the Java API</h2>
</div>
</div>
</div>
<p>Java support is not built automatically. The following instructions
assume that you have installed the Sun Java Development Kit in
<codeclass="filename">d:\java</code>. Of course, if you installed elsewhere or have
different Java software, you will need to adjust the pathnames
accordingly.</p>
<divclass="orderedlist">
<oltype="1">
<li>Set your include directories.
<divclass="itemizedlist"><ultype="disc"><li>
In Visual Studio 2005/Visual Studio 2008 - Choose <spanclass="emphasis"><em>Tools -> Options
-> Projects -> VC++ Directories</em></span>. Under the "Show
directories for" pull-down, select "Include files". Add the full
pathnames for the <codeclass="filename">d:\java\include</code> and
<codeclass="filename">d:\java\include\win32</code> directories. Then click OK.
</li><li>
In Visual Studio 2010 - Right-click db_java project, choose <spanclass="emphasis"><em>Properties->Configuration Properties-> VC++ Directories->Include Directories</em></span>.
Add the full pathnames for the <codeclass="filename">d:\java\include</code> and <codeclass="filename">d:\java\include\win32</code> directories. Then click OK.
</li></ul></div>
These are
the directories needed when including jni.h.</li>
<li>Set the executable files directories.
<divclass="itemizedlist"><ultype="disc"><li>
In Visual Studio 2005/Visual Studio 2008 - Choose <spanclass="emphasis"><em>Tools ->
Options -> Projects -> VC++ Directories</em></span>. Under the "Show
directories for" pull-down, select "Executable files". Add the full
pathname for the <codeclass="filename">d:\java\bin</code> directory, then click OK.
</li><li>
In Visual Studio 2010 - Right-click db_java project, choose <spanclass="emphasis"><em>Properties->Configuration Properties-> VC++ Directories->Executable Directories</em></span>. Add the full pathnames for the <codeclass="filename">d:\java\bin</code> directories. Then click OK.
</li></ul></div>
This is the directory needed to find javac.</li>
<li>Set the build type to Release or Debug in the drop-down on the
tool bar.</li>
<li>
<p>
To build, right-click on db_java and select Build. This builds the
Java support library for Berkeley DB and compiles all the java files,
placing the resulting <codeclass="filename">db.jar</code> and
<codeclass="filename">dbexamples.jar</code> files in one of the following
Berkeley DB subdirectories, depending on the configuration that you chose: