[gdal-dev] Java SWIG Bindings

Meek, Allan (Contractor) Allan.Meek at drdc-rddc.gc.ca
Mon Jan 7 12:58:58 EST 2008


Hi,

I'm currently trying to get GDAL 1.4.4 working with Java, but I've run
into problems in both Linux and Windows. I have been following the
instructions I found at
http://lists.osgeo.org/pipermail/gdal-dev/2006-February/007867.html.

In Linux, everything looks fine right up to the point where I try to run
the gdalinfo or TESTgdal programs:

  (from {...}/swig/java/apps)
  java -cp ../gdal.jar -Djava.library.path=../.libs/ gdalinfo

  Exception in thread "main" java.lang.NoClassDefFoundError: gdalinfo

If I remove "-cp ../gdal.jar", I seem to get farther, but it all crashes
at the first call to a GDAL function, gdal.AllRegister():

  java -Djava.library.path=../.libs/ gdalinfo

  Exception in thread "main" java.lang.NoClassDefFoundError: 
  org/gdal/gdal/gdal at gdalinfo.main(gdalinfo.java:64)

In Windows, I get stuck at step 2: when I run "nmake -f makefile.vc", I
get the following error:

  {...}
  fatal error 1073: don't know how to make 'ogr_wrap.obj.'
  Stop.
  {...}

Does anybody have any advice to help me get around these problems?

Thanks,
Allan



More information about the gdal-dev mailing list