[gdal-dev] Using the GDAL/OGR Java bindings with the OSGeo4W environment

MarvinCO marvin.offiah at googlemail.com
Sun Apr 24 13:37:07 EDT 2011


Hi,

I have installed GDAL and GDAL for Jave with the OSGeo4W installer.

I am using an Eclipse project and have set the JRE that was installed by the
OSGeo4W installer as the JRE to use in my project. I have also added the
gdal.java from OSGeo4W (in the "lib" directory) to the java class path.

Now I'm trying to run this:

System.loadLibrary("gdal18");
ogr.RegisterAll();
ogr.Open(ds, 0);

where "ds" is a certain data source. Unfortunately, I am getting this error:




Native library load failed.
java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.HasThreadSupport()I
Native library load failed.
java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.HasThreadSupport()I
Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.gdal.ogr.ogrJNI.Open__SWIG_0(Ljava/lang/String;I)J
	at org.gdal.ogr.ogrJNI.Open__SWIG_0(Native Method)
	at org.gdal.ogr.ogr.Open(ogr.java:127)





Why? Can anyone help? As said, I have used the OSGeo4W installer to install
GDAL and GDAL for Java. The installer is supposed to automatically add the
necessary dependencies?

Thanks in advance
Marvin

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Using-the-GDAL-OGR-Java-bindings-with-the-OSGeo4W-environment-tp6301272p6301272.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list