<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><span id="ms-rterangepaste-start"></span></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
I have been struggling to get a working gdal.jar for both Windows and Linux for a few days/weeks now.  A previous issue reported to the mailing list outlines the issue: <a href="http://lists.osgeo.org/pipermail/gdal-dev/2016-January/043357.html" target="_blank" id="LPlnk967762">http://lists.osgeo.org/pipermail/gdal-dev/2016-January/043357.html</a></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
For windows, I am using Windows 10 64 bit, along with the 64-bit GDAL dev release which reports to be 2.1.0beta1 when I run gdalinfo --version.  This is also confirmed by the information page for the release: <a href="http://www.gisinternals.com/packageinfo.php?file=release-1800-x64-gdal-mapserver.zip" target="_blank" id="LPlnk968057" title="http://www.gisinternals.com/packageinfo.php?file=release-1800-x64-gdal-mapserver.zip
Ctrl+Click or tap to follow the link">http://www.gisinternals.com/packageinfo.php?file=release-1800-x64-gdal-mapserver.zip</a>.
  They also state that it was compiled with SWIG 2.0.4 but I have no way to independently verify that.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
On Linux, I get the stable release of 2.1.0 and compile it just fine, using SWIG 2.0.4 as stated in the earlier thread.  I make the GDAL java bindings with no issue.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
The problem seems to be Windows will NOT use the jar compiled on Linux and vice versa.  Whenever I try to use the Jar from one platform on another platform, I get an UnsatisfiedLink exception pointing to either Dataset_SWIGUpcast or SWIGDatasetUpcast being
 the problem.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
On each platform I have the location of the GDAL JNI files in the PATH (Windows) or LD_LIBRARY_PATH (Linux).  I use Gradle to build and run my software on each platform, and the GDAL jar is being imported in the gradle file from a lib folder.  <font face="Calibri,Arial,Helvetica,sans-serif,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" size="2"><span style="font-size: 16px;">As
 mentioned in the thread Even Roualt </span></font><font face="Calibri,Arial,Helvetica,sans-serif,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols" size="2"><span style="font-size: 16px;">responded to, I have tried
 numerous times on Linux to build the bindings for SWIG using version 1.3.40, 2.0.4, and even 3.0.x.  Nothing I do can get this Upcast issue to go away.</span></font></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* Is this just not possible?  Do I absolutely have to use the same jar compiled for my platform?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* All GISInternals releases seem to use SWIGDatasetUpcast to register GDAL drivers</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* 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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* Are the CPP files for gdalJNI not the same for each platform?  How is it I am getting two different scenarios where Windows will only work if SWIGDatasetUpcast is present and Linux will only work if Dataset_SWIGUpcast is present in gdalJNI.class?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* Ultimately I just want to be able to use 1 gdal.jar in my project so that IntelliJ does not have to worry about which version to load.  IntelliJ names the Jar explicitly in it's module folder structure and those files are supposed to be in source.  If that
 file is different for Windows and Linux users, then that creates version headaches for my devs.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
* I can easily make this issue moot by having gradle detect my platform and load the appropriate jar by unique name at test/compile time, but that will not work for my IntelliJ/source control issue</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
Any ideas?  I am struggling to think of other ways to troubleshoot this issue..</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div id="Signature" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<div style="margin: 0px;"><font face="Calibri,Arial,Helvetica,sans-serif">Steven D. Lander, Software Engineer
<div>Reinventing Geospatial, Inc</div>
<div> </div>
<div>Steven.Lander AT rgi-corp DOT com</div>
</font></div>
</div>
<p></p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><span id="ms-rterangepaste-end"></span></div>
</div>
</div>
</div>
</body>
</html>