[gdal-dev] JRE vs JDK

Even Rouault even.rouault at mines-paris.org
Fri Oct 26 11:26:47 PDT 2012


Le vendredi 26 octobre 2012 17:52:18, Ivan Lucena a écrit :
> Hi there,
> 
> I am getting this exception when loading gdal.jar:
> 
> *
> Native library load failed.
> java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.HasThreadSupport()I
> *
> 
> If I change the script that launch my application to use the "java.exe"
> from the JDK instead of the JRE then the problem is gone. The problem is
> that users usually have only JRE. Right?
> 
> Anyway, It doesn't seems like there is nothing wrong with the GDAL built. I
> also try the same test with Tamas' binaries but got the same strange
> error.
> 
> An by looking at swig/include/java/*.i I can see that some of the
> loadLibrary would issue that message before the exception.
> 
> "WARNING : GDAL should be compiled with thread support for safe execution
> in Java."
> 
> But I am not getting it. So the error must be coming from loading
> "gdalconstjni.dll" or "osrjni.dll" but not "gdaljni.dll" or "ogrjni.dll"
> 
> I haven't tried that with Linux but I will.
> 
> I search for "java.lang.UnsatisfiedLinkError:
> org.gdal.gdal.gdalJNI.HasThreadSupport()I" on the web there are a hand
> full of question about that but none of the suggestions mentioned the JRE
> vs JDK issue.
> 
> Does anybody has a clue?

I'm a bit skeptical about this being a JRE vs JDK issue. I suspect that you 
have an issue with the supporting dll (the 4 jni ones and gdalXXX.dll and its 
dependencies) not being found in the PATH.

I've just tried with an older release-1500-dev.zip from Tamas site and a JRE. 

I put gdalinfo.class (compiled from the samples in swig/java/apps) in C:
\release-1500-dev\release-1500\bin\gdal\java

And then, after calling SDKShell.bat, just run from there :

C:\release-1500-dev\release-1500\bin\gdal\java>java -cp gdal.jar;. gdalinfo

Seems to work.

Regards,

Even


More information about the gdal-dev mailing list