<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Adam,</p>
    <p>I cannot help with Mac specificities, but on Ubuntu 20.04, after
      "sudo apt install openjdk-17-jdk openjdk-17-jre", the GDAL Java
      bindings build work just fine and the Java tests run with "ctest
      -R java" as well.<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 03/01/2023 à 18:33, adamgutonski via
      gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:1gAkJdtLYoujD8AbzTFnNP8xNf7BLbzs8aqHcci32peepL3Qb3xp9rJYs3Fr_R3HA9QH3qopmlUlpmRqTXHBTl9eN2rDsbqSxjAMKB6M1Vs=@protonmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      Hello,<br>
      <br>
      <div>My question is, is it possible to build the GDAL bindings for
        Java 17?  I am trying to build GDAL with Java bindings for Java
        temurin-17.jdk when prior I have been able to build and use the
        bindings successfully for Java adoptopenjdk-8.jdk, using the
        exact same build process.  However when I run the equivalent
        build steps with Java 17 I continue to receive this link error
        when implementing the bindings:<br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"><br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"><span><b>Native library load failed.</b></span>
        <div><b>java.lang.UnsatisfiedLinkError: no gdalalljni in
            java.library.path:</b> ...</div>
        <div><span>Exception in thread "main"
            java.lang.UnsatisfiedLinkError: 'void
            org.gdal.gdal.gdalJNI.AllRegister()'</span></div>
        <div><span> at org.gdal.gdal.gdalJNI.AllRegister(Native Method)</span></div>
        <div><span> at org.gdal.gdal.gdal.AllRegister(gdal.java:664)</span></div>
        <span> at Main.main(Main.java:14)</span><br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"><br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);">My system specs:</div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"> 
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>System Version: macOS 12.6.1 (21G217)</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Kernel Version: Darwin 21.6.0</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Boot Volume: Macintosh HD</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Boot Mode: Normal</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Secure Virtual Memory: Enabled</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>System Integrity Protection: Enabled</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Time since boot: 15 days 20:17</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Model Name: MacBook Pro</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Model Identifier: MacBookPro18,3</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><span>   
                </span>Chip: Apple M1 Pro</span></p>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"><br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);">When I run the build I see that the Java bindings are
        generated, the .jar and <span>libgdalalljni.dylib are created
          in /build/swig/java.  </span>Here are the build commands used:</div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);"><br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);">
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures">sudo arch
            -x86_64 /usr/local/homebrew/bin/cmake ..
            -DCMAKE_BUILD_TYPE=Release
            -DCMAKE_INSTALL_PREFIX=/usr/local/bin
            -DBUILD_JAVA_BINDINGS=ON -DBUILD_PYTHON_BINDINGS=OFF
            -DCMAKE_OSX_ARCHITECTURES=x86_64 -DGDAL_USE_ZSTD=OFF</span></p>
        <br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);">
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures">sudo arch
            -x86_64 /usr/local/homebrew/bin/cmake --build .</span></p>
        <br>
      </div>
      <div style="font-family: Arial; font-size: 14px; color: rgb(0, 0,
        0);">
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures">sudo arch
            -x86_64 /usr/local/homebrew/bin/cmake --build . --target
            install</span></p>
        <p style="margin:0px;font:11px Menlo"><span
            style="font-variant-ligatures:no-common-ligatures"><br>
          </span></p>
      </div>
      <div>Again, all of the above steps work when I am using JDK 8.  So
        does GDAL support Java bindings for JDK 17?  Is there a way to
        resolve the error <b
          style="font-family:Arial;background-color:rgb(255, 255, 255)">no
          gdalalljni in java.library.path? </b><span
          style="font-family:Arial;background-color:rgb(255, 255, 255)">Here
          are the path settings in IntelliJ IDE:</span></div>
      <div><b style="font-family:Arial;background-color:rgb(255, 255,
          255)"><br>
        </b></div>
      <div><b style="font-family:Arial;background-color:rgb(255, 255,
          255)"><span style="color:rgb(23, 43, 77);font-family:SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace;font-weight:400;text-align:left;white-space:pre;background-color:rgb(244, 245, 247)">VM options: -Djava.library.path=/Users/<username>/code/gdal-<version>/build/swig/java:$PATH$
</span><span style="color:rgb(23, 43, 77);font-family:SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace;font-weight:400;text-align:left;white-space:pre;background-color:rgb(244, 245, 247);display:inline !important">Environment Vars: PATH=/Users/<username>/code/gdal-<version>:/Users/<username>/code/gdal-<version>/build/swig/java:$PATH$</span> </b><br>
      </div>
      <br>
      <br>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>