[Xapian-discuss] Has anyone gotten Xapian java bindings to work with Eclipse?

Olly Betts olly at survex.com
Tue Jul 1 06:56:11 BST 2008


On Wed, Jun 18, 2008 at 03:11:24PM -0400, Jim wrote:
> OK so I'm convinced I should be using java-swig even though the top 
> level readme doesn't even mention it.

The "java-swig" bindings are a work in progress.  They are included in
the tarballs for the convenience of those who are happy to use them, but
not yet mentioned in the README to avoid people using them without
fully realising their status, and then being disappointed when they
discover the rough edges, or find the Java API changes underneath them.

> I did a make in the java-swig 
> directory and then listed the contents of the jar file.  To my 
> amazement, I found they were not in a package. 

Yes, this is one of the issues.  SWIG has an option to put them in a
package, but there was some problem with using it which is as yet
unresolved (I don't recall the problem, but if you get an SVN tree
and bootstrap it, then you can restore the commented out "-package
org.xapian" in java-swig/Makefile.am and the problem should be evident).

Patches to improve the java-swig bindings are most welcome.  Otherwise
if they don't work for you currently, you'll probably just have to wait
for me to find time to finish them.

> I don't know how to import them.  I moved the jar to the WEB-INF/lib 
> directory in Eclipse, refreshed the project and the compiler complains 
> about "Stem cannot be resolved to a type" and "Document cannot be 
> resolved to a type", etc.
>
> So I'm guessing that I have to perform some magic to get these classes 
> recognized.  Any suggestions as to how to do that?

I know nothing about Eclipse, other than it's some sort of Java-oriented
IDE, so I can't help here I'm afraid.  Perhaps the Eclipse list is a
better place to ask about this?

Cheers,
    Olly



More information about the Xapian-discuss mailing list