[Xapian-discuss] Java Swig bindings for Xapian 1.0.6 on Windows

Jarrod Roberson jarrod at vertigrated.com
Mon Apr 7 17:28:48 BST 2008


On Mon, Apr 7, 2008 at 11:46 AM, Charlie Hull <charlie at juggler.net> wrote:

> Jarrod Roberson wrote:
>
> >
> >
> > On Mon, Apr 7, 2008 at 10:30 AM, Charlie Hull <charlie at juggler.net<mailto:
> > charlie at juggler.net>> wrote:
> >
> >    Hi all,
> >
> >    I've now managed to create a makefile for the Java Swig bindings
> > under
> >    Windows: I have now added this to the MSVC makefiles available from
> >    http://lemurconsulting.com/Products/Xapian/Overview.shtml
> >
> >
> > I got xapian to compile without any errors finally.
> > There are a couple of small issues I have discovered with the java-swig
> > bindings.
> > 1. java-swig\Makefile is hard coded somewhere to use JDK 1.6.05, I had
> > 1.6.04, I downloaded the newer version and it worked.
> >
>
> Hi Jarrod,
>
> This is from config.mak, which you'll need to edit to match your system -
> look for the Java section.
>
> >
> > 2. but now I get the following, I am almost there :-(
> >
> > C:\Documents and Settings\jroberson\My
> > Documents\DOWNLOADS\xapian-bindings-1.0.6\java-swig>nmake
> >
> > Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
> > Copyright (C) Microsoft Corporation.  All rights reserved.
> >
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Auto.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Flint.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . InMemory.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Quartz.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Remote.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Version.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\javac.exe" -classpath . -d
> > . Xapian.java
> >        "C:\Program Files\Java\jdk1.6.0_05\bin\jar.exe" -cf
> > ..\..\xapian-core-1.0.6\win32\Release\Java-Swig/xapian_jni.jar  Auto.class
> > BM25Weight.class BoolWeight.class Database.class DateValueRangePr
> > ocessor.class Document.class Enquire.class ESet.class ESetIterator.class
> > ExpandDecider.class Flint.class InMemory.class MatchDecider.class MSet.class
> > MSetIterator.class MultiValueSorter.class NumberVa
> > lueRangeProcessor.class PositionIterator.class PostingIterator.class
> > Quartz.class Query.class QueryParser.class Remote.class RSet.class
> > SimpleStopper.class Sorter.class Stem.class Stopper.class String
> > ValueRangeProcessor.class SWIGTYPE_p_std__string.class
> > TermGenerator.class TermIterator.class TradWeight.class ValueIterator.class
> > ValueRangeProcessor.class Version.class Weight.class WritableDatabase
> > .class Xapian.class XapianConstants.class XapianJNI.class
> >  Enquire*docid_order.class Query*op.class QueryParser*feature_flag.class
> > QueryParser*stem_strategy.class TermGenerator*flags.class
> > java.io.FileNotFoundException:
> > ..\..\xapian-core-1.0.6\win32\Release\Java-Swig\xapian_jni.jar (The system
> > cannot find the path specified)
> >
>
> The makefiles for the bindings have a 'relative path' set up in the first
> few lines, this will probably also need changing to match your system - it's
> called XAPIAN_CORE_REL_JAVA.
>
> Once you fix this it should all work! Note that the make files are copied
> across to the bindings directory during the main make process (i.e. when you
> build the rest of Xapian) - so the best thing to do is find the
> xapian-core-1.0.6/win32 folder, edit win32_bindings_java-swig.mak and then
> from within this folder run 'nmake COPYMAKFILES' which will copy it across.
>
> It's all a bit complicated I'm afraid but explained in more detail in
> README.
>
> Cheers
>
> Charlie
>
>
>         at java.io.FileOutputStream.open(Native Method)
> >        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> >        at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
> >        at sun.tools.jar.Main.run(Main.java:150)
> >        at sun.tools.jar.Main.main(Main.java:1022)
> > NMAKE : fatal error U1077: '"C:\Program
> > Files\Java\jdk1.6.0_05\bin\jar.exe"' : return code '0x1'
> > Stop.
> >
>
>
ok I just wanted to make sure this made it back to the mailing list.
I got it all working now, thanks Charlie for your awesome work.
Here is a tip that others might over look.
Be sure and add zlib1.dll to your  C:\WINDOWS\system directory or you will
get a very unhelpful error from the bindings about not being able to find
dependencies without it actually telling you what dependency it needs.


There is still one problem, and it seems to be more with SWIG than anything
else. the java-swig bindings end up in the default package instead of the
Xapian package. Once that is fixed everything look slike it will be good to
go.


More information about the Xapian-discuss mailing list