Hi,<br><br>While I'm not sure about the layout of the files throughout the application, I may suppose some of the dependent libraries are not available in the common dll search locations. You may probably inspect this with a file monitoring tool (like <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">process monitor</a>) and see the expected locations of the files. You may probably set the PATH environment for the process to point to the direcory where those dll-s reside.<br>
<br><br>Best regards,<br><br>Tamas<br><br><br><div class="gmail_quote">2010/11/20 MarvinCO <span dir="ltr"><<a href="mailto:marvin.offiah@googlemail.com">marvin.offiah@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
Hey,<br>
<br>
I am trying to write a Java application that uses GDAL on Windows 7. I am<br>
using the Java bindings of GDAL together with the gdal DLLs from the GDAL<br>
download page.<br>
<br>
I hope you are familiar with the distributions I'm using:<br>
<br>
GDAL DLLs:<br>
imageio-ext-1.0.5-windows32-dlls/*<br>
<br>
GDAL Java bindings:<br>
imageio-ext-1.0.8-libraries/*<br>
<br>
I have copied all the DLLs into my jre/bin directory of my Java Runtime<br>
environment.<br>
<br>
Everything works fine if I run the program via the Eclilpse run<br>
configuration. GDAL libraries are properly loaded, and are able to read a<br>
shapefile that my program opens and display its contents.<br>
<br>
My program starts like this:<br>
<br>
package mapillustrator;<br>
<br>
import javax.swing.JLabel;<br>
import javax.swing.JOptionPane;<br>
<br>
import mapillustrator.controller.Controller;<br>
import mapillustrator.view.MainWindow;<br>
<br>
import org.gdal.ogr.ogr;<br>
<br>
/*<br>
* To change this template, choose Tools | Templates and open the template<br>
in<br>
* the editor.<br>
*/<br>
<br>
/**<br>
*<br>
* @author marvin<br>
*/<br>
public class MapIllustrator {<br>
<br>
public static Controller controller;<br>
<br>
public static MainWindow mainWindow;<br>
<br>
public static void main(String[] args) throws Exception {<br>
try {<br>
System.loadLibrary("gdal14");<br>
ogr.RegisterAll();<br>
controller = new Controller(args[0]);<br>
mainWindow = new MainWindow(null, true);<br>
} catch (Exception e) {<br>
JOptionPane.showMessageDialog(new JLabel(), e.getMessage());<br>
e.printStackTrace();<br>
}<br>
}<br>
<br>
}<br>
<br>
So, as I said, all this works fine.<br>
<br>
However, I now want to have the main method launched via a python script for<br>
some reason, so here's my python script (the script is located at<br>
"C:\Program Files\Inkscape\share\extensions"):<br>
<br>
import os, sys, subprocess, time<br>
<br>
dir = os.getcwd().replace("\\", "/") + "/share/extensions/MapIllustrator/"<br>
libdir = dir + "lib/"<br>
<br>
subprocess.Popen("java -verbose -classpath \".;C:/Program<br>
Files/Java/jre6/lib/ext/QTJava.zip;" + dir + "build/classes;" + libdir +<br>
"*;" + libdir + "SuperCSV-1.52/*;" + libdir + "batik-1.7/*;" + libdir +<br>
"batik-1.7/lib/*;" + libdir + "batik-1.7/extensions/*;" + libdir +<br>
"imageio-ext-1.0.8-libraries/*;" + "\" mapillustrator.MapIllustrator \"" +<br>
sys.argv[-1] + "\"", stdout=True)<br>
<br>
But everytime I launch my application via the script I get an<br>
UnsatisfiedLinkError of the kind<br>
<br>
"gdal14.dll: Can't find dependent libraries"<br>
<br>
I'm really wondering why I am not getting this error if I launch my program<br>
via Eclipse. No such error occurs there and GDAL manages to load all the<br>
libraries and does not complain about any dependencies.<br>
Obviously, the gdal14.dll is found. I'm using the JDK1.6.0.22 with Eclipse.<br>
Its JRE is also configured as the default JRE in my windows registry:<br>
<br>
C:\Program Files\Java\jdk1.6.0_21\jre<br>
<br>
As I said, I have also copied all files from the<br>
imageio-ext-1.0.5-windows32-dlls/* into the "C:\Program<br>
Files\Java\jdk1.6.0_21\jre\bin". I have also tried copying them to<br>
"C:\Program Files\Java\jdk1.6.0_21\bin" instead. The all Java bindings for<br>
GDAL are also included in the Java classpath in my Eclipse project settings.<br>
As you can see in the Python script, I am also doing that above.<br>
<br>
So obviously, there has to be a difference in how Eclipse launches my Java<br>
program and in how the python script does. I don't see any other<br>
explanation, and I also don't know what on earth Eclipse does different to<br>
have it run without a problem. There isn't a single argument set in my run<br>
configuration. I don't know how Eclipse actually transfers the classpath<br>
arguments of the project settings into the program launch (probably adds the<br>
-classpath <...> argument on its own), but other than that I'd really like<br>
to know what I am doing wrong.<br>
The only difference between running from Eclipse and running via my python<br>
script seems to be that my python script is that both are calling java from<br>
a different current working directory: The project home in Eclipse VS<br>
"C:\Program Files\Inkscape" in the script. The script is being launched as<br>
an Inkscape extension. I don't know why Inkscape sets the CWD to<br>
"C:\Program Files\Inkscape", although it is located at "C:\Program<br>
Files\Inkscape\share\extensions"<br>
<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/UnsatisfiedLinkError-with-gdal14-tp5759026p5759026.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/UnsatisfiedLinkError-with-gdal14-tp5759026p5759026.html</a><br>
<div class="im">Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
</div>_______________________________________________<br>
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><br>
</blockquote></div><br>