[redland-dev] Troubles in building java bindings

Dave Beckett dave at dajobe.org
Sat Apr 29 16:58:55 BST 2006


Attilio Fiandrotti wrote:
> Hi
> 
> I'm trying to build java bindings from SVN (i'm working with 10882
> version from SVN) using sun's sdk 1.4.2_11.
> I configured bindings with
> 
> sh autogen.sh --with-java=/usr/share/j2sdk1.4.2_11/bin/java
> --with-jdk=/usr/share/j2sdk1.4.2_11/
> 
> and later make returns this error message to me
> 
> here=`pwd`; \
>         cd org/librdf/redland/; \
>         swig -v -java -noproxy -module core -package org.librdf.redland
> -o core_wrap.c ; \
>         if test -r coreJNI.java; then \
>           echo "Fixing SWIG 1.3.15+ broken Java API"; \
>           rm -f core.java SWIGTYPE_*; \
>           sed -e 's/class coreJNI/public class core/' coreJNI.java >
> core.java; \
>           sed -e 's/coreJNI/core/g' core_wrap.c > core_wrap.c.new; \
>           rm -f core_wrap.c coreJNI.java; \
>           mv core_wrap.c.new core_wrap.c; \
>         fi; \
>         mv core_wrap.c $here; \
>         mv core.java core.java.in
> Must specify an input file. Use -help for available options.

This was an unhelpful error message from 'swig' since it didn't say what
program wanted an input file.

It's from this line:
         swig -v -java -noproxy -module core -package org.librdf.redland
 -o core_wrap.c ; \

which is missing a reference to the Redland SWIG interface file, Redland.i.
 The bindings configure tries to find this by running redland-config --swig
but this must have failed.

>From a typical install (debian packages) you get:
$ redland-config --swig
/usr/share/redland/Redland.i


> mv: impossibile fare stat di `core_wrap.c': No such file or directory
> mv: impossibile fare stat di `core.java': No such file or directory
> make[2]: *** [core_wrap.c] Error 1
> make[2]: Leaving directory `/home/attilio/svn/redland/bindings/java'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/attilio/svn/redland/bindings/java'
> make: *** [all-recursive] Error 1
> 
> i have installed SWIG Version 1.3.28.
> 
> If i "touch" the missing files, the building process terminates with

Yeah that won't help, you need to run swig over Redland.i

> javac skeleton.java
> ./org/librdf/redland/core.java:26: 'class' or 'interface' expected
>     {
>     ^
> ./org/librdf/redland/core.java:37: 'class' or 'interface' expected
> }
> ^
> ./org/librdf/redland/core.java:38: 'class' or 'interface' expected
> ^
> skeleton.java:22: cannot access org.librdf.redland.core
> bad class file: ./org/librdf/redland/core.java
> file does not contain class org.librdf.redland.core
> Please remove or make sure it appears in the correct subdirectory of the
> classpath.
> import org.librdf.redland.core;
>                           ^
> 4 errors
> make[1]: *** [skeleton.class] Error 1
> make[1]: Leaving directory `/home/attilio/svn/redland/bindings/java'
> make: *** [all-recursive] Error 1
> 
> do someone knows what am i doing wrong?

Using Java? :)

Well, more seriously, I don't spend much time on them so I still consider
them experimental.  They probably work if 'make check' works.

Dave


More information about the redland-dev mailing list