<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If one native library (DLL) loads another, the “java.library.path”
variable will not be honored, since it’s not Java doing the load, but the
OS trying to resolve the dependencies for the DLL. As Daniele suggested,
Dependency Walker is a great tool for finding out the relationships between
libraries.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>To solve this problem in software I write, I often do a “defensive
load”. You can call System.loadLibrary() with the secondary library
and have Java load it up from the “java.library.path”. Then,
when the JNI library is loaded, the library it depends on will already be in
memory ready to go. Using this technique I have never had to place native
libraries in the JDK itself. This method work only on windows, where DLLs
are reused in a process by default, and will most likely not work on other
platforms.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>--<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ben<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b>On
Behalf Of </b>Daniele Romagnoli<br>
<b>Sent:</b> Monday, February 23, 2009 6:24 AM<br>
<b>To:</b> trailcode<br>
<b>Cc:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [Gdal-dev] GDAL 1.6 Java binding, Windows<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br>
please read below.<o:p></o:p></p>
<div>
<p class=MsoNormal>On Mon, Feb 23, 2009 at 12:06 AM, trailcode <<a
href="mailto:trailcode@gmail.com">trailcode@gmail.com</a>> wrote:<o:p></o:p></p>
<p class=MsoNormal><br>
I got gdal java binding to work with win32. I downloaded the jre from:<br>
<a href="http://udig.refractions.net/files/downloads/jre/" target="_blank">http://udig.refractions.net/files/downloads/jre/</a><o:p></o:p></p>
<div>
<p class=MsoNormal><br>
Note that these libraries have been built against GDAL 1.4.4.<br>
Where do you have placed the DLLs to let them work during your first test?<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<p class=MsoNormal><br>
<br>
And used it to execute my test program. For the java .jar files I am not<br>
using gdal.jar but the jars which come with: imageio-ext<br>
<br>
The thing which is strange is if I copy the gdaljni.dll gdal14.dll and other<br>
.dll files from the jdk downloaded above to my project dir and set my<br>
java.library.path to point to them I get the same old unsatisfied link<br>
error. I even tried copying over all .dll files in the JDK tree but got the<br>
same message.<br>
<br>
Does anyone have any idea what is going on here?<o:p></o:p></p>
</blockquote>
<div>
<p class=MsoNormal><br>
On Windows, we have sometime noticed similar issues on DLL native libs loading.
Not sure what is happening when this occurs. (Be sure that all required
libraries are together with these DLLs (A check with "Dependency
walker" may be helpful)).<br>
A solution could be putting them on your JDK/bin being sure that the same libs
aren't somewhere on folders linked by your PATH env. (Be sure you don't
have old GDAL Libs somewhere hidden on your machine)<br>
This could be helpful to do some initial testings. See my next feeddback about
JNLP.<br>
<o:p></o:p></p>
</div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<p class=MsoNormal><br>
<br>
I would like to create an application distributable via jnlp.<o:p></o:p></p>
</blockquote>
<div>
<p class=MsoNormal><br>
We are working on creating a web start application involving other native
libraries (not GDAL related). <br>
Therefore we will handle native DLLs loading and some feedbacks on this topic
will come in the near future (we are working on it this week).<br>
<br>
Cheers,<br>
Daniele<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<p class=MsoNormal><br>
<br>
Thanks,<br>
Matthew Tang<br>
<span style='color:#888888'>--<br>
View this message in context: <a
href="http://n2.nabble.com/GDAL-1.6-Java-binding%2C-Windows-tp2299600p2369562.html"
target="_blank">http://n2.nabble.com/GDAL-1.6-Java-binding%2C-Windows-tp2299600p2369562.html</a></span><o:p></o:p></p>
<div>
<p class=MsoNormal>Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal>gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br clear=all>
<br>
-- <br>
-------------------------------------------------------<br>
Eng. Daniele Romagnoli <br>
Software Engineer<br>
<br>
GeoSolutions S.A.S.<br>
Via Carignoni 51<br>
55041 Camaiore (LU)<br>
Italy<br>
<br>
phone: +39 0584983027<br>
fax: +39 0584983027<br>
mob: +39 328 0559267<br>
<br>
<br>
<a href="http://www.geo-solutions.it">http://www.geo-solutions.it</a><br>
<br>
-------------------------------------------------------<o:p></o:p></p>
</div>
</div>
</body>
</html>