[gdal-dev] Native library load failed while using gdal maven dependency - UnsatisfiedLinkError

ssaniev ssaniev at gmail.com
Wed Feb 10 06:29:18 PST 2016


So the solution for using gdal bindings in java was to install the proper
version which came with all the dll's and simply using the jar from the
maven repo.

I installed core gdal installer in windows, and set my environment
variables, and gdal jar started to work correctly in my maven project.

Installer used:
http://www.gisinternals.com/release.php
gdal-111-1800-x64-core.msi	Generic installer for the GDAL core components
http://download.gisinternals.com/sdk/downloads/release-1800-x64-gdal-1-11-3-mapserver-6-4-2/gdal-111-1800-x64-core.msi

maven dependency:
<dependency>
	<groupId>org.gdal</groupId>
	<artifactId>gdal</artifactId>
	<version>1.11.2</version>
</dependency>
			

Environment variables:
GDAL_BIN=C:\Program Files\GDAL
GDAL_DATA=C:\Program Files\GDAL\gdal-data
GDAL_DRIVER=C:\Program Files\GDAL\gdalplugins

Also in eclipse, passing in as a VM argument to find needed *.dll-s :
-Djava.library.path="C:\Program Files\GDAL;${env_var:PATH}"

---------------------------------------

So code works at this point. 

import org.gdal.gdal.gdal;
import org.gdal.ogr.ogr;

public class ShapeFileWorker {
    ogr.RegisterAll();
    gdal.AllRegister();
    gdal.VersionInfo();
}



Pulled a lot of hairs until now, but finally works.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Native-library-load-failed-while-using-gdal-maven-dependency-UnsatisfiedLinkError-tp5249728p5249930.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list