[gdal-dev] Unable to get multi-platform JAR working for GDAL 2.x

Even Rouault even.rouault at spatialys.com
Tue May 3 10:19:54 PDT 2016


> * Linux builds make
> Dataset_SWIGUpcast no matter what SWIG version I compile with.  I have
> verified this by compiling the java swig project, unzipping the Jars, and
> running the GNU strings command on the gdalJNI.class file to see the
> method names in that file.

Here with SWIG 1.3.40 on Linux, I see :
gdal_wrap.cpp:SWIGEXPORT jlong JNICALL Java_org_gdal_gdal_gdalJNI_SWIGDatasetUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
org/gdal/gdal/gdalJNI.java:  public final static native long SWIGDriverUpcast(long jarg1);

And with SWIG 2.0.12:
gdal_wrap.cpp:SWIGEXPORT jlong JNICALL Java_org_gdal_gdal_gdalJNI_Dataset_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
org/gdal/gdal/gdalJNI.java:  public final static native long Dataset_SWIGUpcast(long jarg1);

Are you sure you generate the bindings with the swig version you think to ?
You can check this by looking at the header of the generated swig/java/gdal_wrap.cpp for example.
If you switch between swig versions, make sure to do a "make veryclean" in swig/java so that bindings get regenerated at the next build attempt.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list