1

I'm trying to use GeoTools to read a dted file, but I'm having a lot of configuration issues. I'm using eclipse and java. Here is the abridged version of my code:

import org.geotools.coverageio.gdal.dted.DTEDReader;

public class ViewDTED {
public static void main(String[] args) {
try {
DTEDReader reader = new DTEDReader(new File("C:\\temp\\mydted.dt2"));
System.out.println("It worked!");
} catch (Exception e) {
e.printStackTrace();
}
}
}

When I run, the console spits out a message "Warning: Failed to load the Kakadu native libs". It then proceeds to print the stack trace for an UnsatisfiedLinkError.

My system path includes: C:_path C:\Program Files\gdal-1.9.0 C:\%JAVA_HOME%\bin C:\Program Files\Common Files\ESRI\Raster\bin\ntx86

That last one contains a lot of dll's, including the only dll's I found on my machine that have kakadu in their name.

in C:_path I have this:
gdal19.dll
gdaljni.dll
ogrjni.dll
osrjni.dll
gdalconstjni.dll
gdal.jar

Those files were also copied to the root of my eclipse project. My eclipse build path includes gdal.jar and every jar found in C:\Program Files\geotools-2.7.4

In the root of my eclipse project I have this:

gdal19.dll
gdaljni.dll
ogrjni.dll
osrjni.dll
gdalconstjni.dll
kakaducoresys.dll

Oh yeah, I have another environment variable defined: GDAL_DATA is set to "C:\Program Files\gdal-1.9.0"

Would somebody please explain to me why the DTEDReader cannot find the necessary libs?

msknapp
  • 1,595
  • 7
  • 22
  • 39

1 Answers1

0

Check to make sure you are not trying to call 32-bit DLLs from a 64-bit instance of JAVA.

I ran into a similar issue with Kakadu on a Windows server when attempting to get Djatoka working with Fedora Commons. Pathing issues aside, the root cause of problem turned out to be that I was attempting to load the free 32-bit version of the Kakadu libraries from Djatoka on a 64-bit instance of Tomcat and 64-bit version of JAVA.

The JAVA JNI files seemed to be real picky about attempting to communicate with 64/32 bit DLLs (or shared objects), so faking a 64-bit library structure for Kakadu using the renamed 32-bit files will not work.

To resolve the issue I had to install a separate version 32-bit version of both Tomcat and JAVA on the same Windows server so that the 64-bit version of Fedora Commons could talk to the 32-bit version of Kakadu via Djatoka.

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
Rick Sarvas
  • 769
  • 10
  • 20