[gdal-dev] Java SWIG Bindings

Collins, Benjamin collinsb at mitre.org
Mon Jan 7 15:05:48 EST 2008


>-----Original Message-----
>From: gdal-dev-bounces at lists.osgeo.org 
>[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Meek, 
>Allan (Contractor)
>Sent: Monday, January 07, 2008 12:59 PM
>To: gdal-dev at lists.osgeo.org
>Subject: [gdal-dev] Java SWIG Bindings
>
>  (from {...}/swig/java/apps)
>  java -cp ../gdal.jar -Djava.library.path=../.libs/ gdalinfo
>
>  Exception in thread "main" java.lang.NoClassDefFoundError: gdalinfo
You may need to specify -cp .:../gdal.jar to get java to look at your
local folder for class files.

>
>If I remove "-cp ../gdal.jar", ...
Please don't do this.

>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)
This is because you removed the reference to the java gdal classes by
removing ../gdal.jar from the classpath.

>
>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.
>  {...}
>
This is because you're running the command from gdal/swig/java.  Run
"nmake -f makefile.vc java" from gdal/swig.

--
Ben


More information about the gdal-dev mailing list