[gdal-dev] Building for Java on MacOS

David Rush david.rush at wyo.gov
Mon Apr 27 12:26:51 PDT 2020


Andrew:

That's what I thought.  I do have the JDK (OpenJDK 11.0.2).

Ah, found it.  I think I may have both a JRE and JVM confusing things
(confusing me, at least).  Both appear to be the same version, at least.

I've changed my JAVA_HOME in java.opt to reflect where my JDK is
installed.  Also had to change the JAVA_INCLUDE in java.opt because jni.h
is under $JAVA_HOME/include rather than $JAVA_HOME/Headers.

Then it couldn't find "jni_md.h" (machine dependent things, apparently).  I
found it in my JDK installation, and copied it to the current directory
(gdal/swig/java), but it still can't seem to find it:

In file included from gdalconst_wrap.c:154:
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/include/jni.h:45:10:
fatal error: 'jni_md.h' file not found
#include "jni_md.h"

Since the include is in quotes, it should be looking in the current
directory for it, right?  The gdalconst_wrap.c file is in the current
directory, so I'm in the right place.

Suggestions?

David

On Mon, Apr 27, 2020 at 11:52 AM Andrew C Aitchison <andrew at aitchison.me.uk>
wrote:

> On Mon, 27 Apr 2020, David Rush wrote:
>
> > Ivan:
> >
> > Thanks!  That worked.  On to the next error (with make in gdal/swig/java)
> > ...
> >
> > gdalconst_wrap.c:154:10: fatal error: 'jni.h' file not found
> > #include <jni.h>
> >         ^~~~~~~
> > 1 error generated.
> > make: *** [gdalconst_wrap.lo] Error 1
> >
> > Where *should* jni.h come from?  I can't find it anywhere in my Java
> > installation.
>
> I believe it should be in the JDK (Java Development Kit)
> - do you just have the JRE or Java Runtime Environment ?
>
> --
> Andrew C. Aitchison                                     Kendal, UK
>                         andrew at aitchison.me.uk
>

-- 

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/20200427/b06a7900/attachment.html>


More information about the gdal-dev mailing list