[gdal-dev] Building for Java on MacOS

David Rush david.rush at wyo.gov
Fri Apr 24 15:35:54 PDT 2020


Hi.  I'm trying to get to the point where I can use GDAL with Java (on a
Mac now, Linux server box in the future).

Current box is MacOS 10.15.4.

I've D/L the binaries for 2.4 from
https://www.kyngchaos.com/software/frameworks/, and installed, which
appears to have put things
in /Library/Frameworks/GDAL.framework/Versions/2.4

but I didn't find the gdal-*.jar file anywhere in there.  I searched and
found gdal-2.4.0.jar at some heavily-advertising driven web site.

When I try to use GDAL, I get:

java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path

I cannot find a file called "gdalalljin" anywhere.  I forced my
java.library.path to be /Library/Frameworks/GDAL.framework/unix/lib, but
got the same error.

I see that I have /Library/Frameworks/GDAL.framework/unix/lib/libgdal.dylib

I then followed the directions here
https://trac.osgeo.org/gdal/wiki/BuildingOnMac and used Homebrew to build
GDAL, which appears to have installed it in /usr/local, and appears to be
version 2.4.4 (per ogr2ogr --version).

I reset my java.library.path to /usr/local/lib, but I still get the same
error:

java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path:
[/usr/local/lib]

I see that I have /usr/local/lib/libgdal.dylib

So where, exactly, can I get the Java native library that I need, and what
is the canonical source for a gdal-x.y.z.jar file, or instructions to build
one myself?

David

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200424/0ff0bef0/attachment.html>


More information about the gdal-dev mailing list