[gdal-dev] Gdal Java

paul.malm at lfv.se paul.malm at lfv.se
Thu Mar 25 02:38:25 PDT 2021


Hi Stefan,
Thanks for responding on my guestion for help!

-I've downloaded release-1928-x64-gdal-3-2-1-mapserver-7-6-2.zip
and unzipped it to C:\Program Files\Gdal_321.
-Then I added to the system path:
C:\Program Files\Gdal_321\bin\gdal\java and C:\Program Files\Gdal_321\bin.
-Restarted the computer.
Entered Eclipse.
-Set the Class-path to C:\Program Files\Gdal_321\bin\gdal\java\gdal.jar
-Run a simple java program with the commands:
gdalJNI jni= new gdalJNI();
if(jni.HasThreadSupport())
...

The error code I get is:
Native library load failed.
java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.HasThreadSupport()I
            at org.gdal.gdal.gdalJNI.HasThreadSupport(Native Method)
            at org.geotools.jdbcconnection.raster.TransformRaster.<init>(TransformRaster.java:64)
            at org.geotools.jdbcconnection.raster.TransformRaster.main(TransformRaster.java:51)


Then I copy the gdalalljni.dll to C:\Program Files\OpenJDK\jdk-8.0.262.10-hotspot\jre\bin\
And gets the following error code:
Native library load failed.
java.lang.UnsatisfiedLinkError: C:\Program Files\OpenJDK\jdk-8.0.262.10-hotspot\jre\bin\gdalalljni.dll: Det går inte att hitta den angivna proceduren
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.HasThreadSupport()I
            at org.gdal.gdal.gdalJNI.HasThreadSupport(Native Method)


Both GDAL and Java are windows x64.
I would be more then grateful for further help.
/Paul

Från: gdal-dev <gdal-dev-bounces at lists.osgeo.org> För Stefan Moebius via gdal-dev
Skickat: den 24 mars 2021 09:42
Till: gdal-dev at lists.osgeo.org
Ämne: Re: [gdal-dev] Gdal Java


Klicka bara på länkar och öppna bilagor om du litar på avsändaren och vet att innehållet är säkert.
Hi Paul,
I find the binaries provided at https://url11.mailanyone.net/v1/?m=1lOzCg-0001ww-4L&i=57e1b682&c=9fNL_OAF8vCIgrjZs9aaEB2UNNImM6gI8GCzoqAnKNimVVkylHGA07tBJv6IOWRHGmUKKXljttalb7-9fSKoJRXHVHgZZReNymWKG_G2PNsxEfzkrdsDLJ5OCUF6GOAknKU4asXym3XgQgeOGIjYq6tb5x-KYwQMeTZwonVcJUyaCE6P24h0b-tnGHxFOYo8tTg_FMbjprD8DaPQsY7871SA4Agmh43T_JQ3BjKFdtcr_ELXZdLivAPNafJvPSW6 the easiest to use. If you click on one build, e.g. release-1928-x64-gdal-3-2-1-mapserver-7-6-2, you get a number of download options, including several installers. If you use the first one (Compiled binaries in a single .zip package), you get an archive which you need to extract, and which contains a folder bin\gdal\java. In there you find gdal.jar and gdalalljni.dll. Now in order to use this, you need to have

  *   Gdal.jar in your Java Classpath
  *   The extracted bin\gdal\java and bin folders in your Path (in Eclipse: Run Configuration -> Environment -> Select -> Path, then edit the value, or set in the system)
If that doesn't work, you'll need to provide some more detailed description of what issue you are facing.

--
Stefan

From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of paul.malm at lfv.se
Sent: Dienstag, 23. März 2021 08:26
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Gdal Java

Hi list,
is there someone out there who has succeeded in installing Gdal Javabindings in Windows?
I've tried for some weeks now :( and I can't find very much information how to do it I Windows.
gdalalljni.dll is not found for starters (Gdal 3.2.0) but it is there, as installed by the installation process.
I've been asking around on internet, but without any luck.
If these is someone who knows how to do it in Windows with Eclipse, it would be much appreciated to get some info...
It would be nice to have a bullet list (for dummies), from where to get the correct download files, installation, setting environment, what is needed to be set in Eclipse etc. I don't have any experience with javabindings or C++...

Kind regards,
Paul
This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service<https://url11.mailanyone.net/v1/?m=1lOzCg-0001ww-4L&i=57e1b682&c=5keNkrDjrvzwcRXVWHrZdauN_ulzs2IpwrQsOrckW4xafxj1rhUsAUZgKUKb10efCNBee9dHzyBWSkhO6cjwaclASZKpkYv1WRfY9vsqTOkHQyXS0dczjdTZu3MRIofEcvljG4mwYuABAqCuSItDekmhYOUgTI8aLLcAwPM7y1M1vZ2hLYnNkVKEKopxHH8RC1eRVKCFSdNWtP4Q41XCZZJPHH_4RMryRb-6kS1GOYaP0Z02s9CcGMNfK1Rhoem-ADgDfyNZoG7HlIiRc0OQ7w>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210325/166abf98/attachment.html>


More information about the gdal-dev mailing list