Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to build a postgis importer for mutliple shapefiles. After geotools took orders of magnitude longer than shp2pgsql to import my data, I decided to attempt to use the java bindings to GDAL (gdal.jar) for these purposes in the hopes that it will be much faster than geotools with an added ability to import from file geodatabases.

I built and installed GDAL using the following steps:

cd /usr/local/src/gis
tar -xzvf gdal-1.9.2.tar.gz
cd gdal-1.9.2

./configure \
--with-python \
--with-poppler \
--with-pg \
--with-curl \
--with-geos \
--with-jpeg \
--with-png \
--with-expat \ 
--with-xerces \
--with-java=/usr/lib/jvm/jdk1.7.0 \
--with-jvm-lib=/usr/lib/jvm/jdk1.7.0/jre/lib/amd64/server \
--with-jvm-lib-add-rpath=yes \
--with-mdb=yes \

sudo make install 

cd /usr/local/src/gis/gdal-1.9.2/swig/java
#nano into java.opt  and change JAVA_HOME to /usr/lib/jvm/jdk1.7.0

I then run a test class that uses gdal.jar and add the above location to the library path so that java can find the shared objects:


When I run the code I get the following error:

Native library load failed.
java.lang.UnsatisfiedLinkError: no gdalconstjni in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.gdal.gdalconst.gdalconstJNI.GDT_Unknown_get()I
    at org.gdal.gdalconst.gdalconstJNI.GDT_Unknown_get(Native Method)
    at org.gdal.gdalconst.gdalconstConstants.<clinit>(
    at elephantshape.TestGDAL.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main(

What else do I need to do to get java to recognize the shared binaries that I have built and get gdal.jar to not explode?

share|improve this question
up vote 3 down vote accepted

Read the "Running something" section of, and particularly :

"To deploy you need gdal.jar in your class path, the 4 .so files (,, and and in your shared library path."

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.