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

ssaniev ssaniev at gmail.com
Tue Feb 9 08:28:33 PST 2016


Hey guys, 

First time GDAL user here. 

We are trying to load shapefiles into postgresql DB, and were able to do so
with GDAL ogr2ogr CLI utility. 
Following cmd works via cmd: 
ogr2ogr -f PostgreSQL PG:"host='hostName' port='5432' user='userName'
dbname='dbName' password='aPassword'" shapeFileName.shp 


*Next step is to accomplish this in java with GDAL bindings. *

There is a maven dependency for gdal which we included in our pom.xml: 
                <dependency>
                   <groupId>org.gdal</groupId>
                   <artifactId>gdal</artifactId>
                   <version>2.0.0</version>
                </dependency>
                

*We import and simply want to output the version of gdal in java: *

import org.gdal.gdal.gdal; 

public class ShapeFileWorker { 
    public void process(String fileName, String hostAddress) { 
        gdal.VersionInfo() 
    } 
} 


*While trying to use gdal library in our java class, we are getting the
following error: *
java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path 


The development project is in SPRING, and Eclipse IDE. 

After reading many online gdal discussions, I have added GDAL_DATA and
LD_LIBRARY_PATH variables. 

But since we are using gdal maven dependency, we shouldn't need them.

Anyone could point us in the right direction?



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


More information about the gdal-dev mailing list