<div dir="ltr">Class file version 61 represents Java 17.<br><div><br></div><div>When the minor version of the class file is 65535, it means that the class is compiled when the preview feature is enabled. You need to pass the --enable preview JVM option at runtime to run.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 21, 2023 at 10:36 PM Martin Pernollet <<a href="mailto:martin.pernollet@protonmail.com">martin.pernollet@protonmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-family:Arial;font-size:14px">Stupid me! One year ago we discussed this and the solution was to use $func on macOS instead of $callback on Linux. I do not remember the reason for this, but that would be handy to have a single name pattern across all OS :)</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">So thanks to your help I succeeded bumping to JDK19 an can run all tests and demos of PanamaGL on macOS. </div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Now a last issue - probably my IDE rather than FFM/JExtract but maybe you have a suggestion : </div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px"><p style="margin:0px;font:12px Helvetica;color:rgb(225,30,70)">Error: LinkageError occurred while loading main class demos.panamagl.macos.swing.DemoTeapot_Onscreen_macOS_Swing</p><p style="margin:0px;font:12px Helvetica;color:rgb(225,30,70)"><span style="white-space:pre-wrap"> </span>java.lang.UnsupportedClassVersionError: demos/panamagl/macos/swing/DemoTeapot_Onscreen_macOS_Swing (class file version 61.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 63.65535</p>  </div><div style="font-family:Arial;font-size:14px">Is triggered as soon as I edit a file that depend on a maven artifact containing the bindings. </div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">To avoid this, I clean install the module containing the demo and this fix it.</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">My Eclipse IDE is configured for using JDK 19.0.2 like Maven, and I am sure I depend on bindings built with JDK 19.0.2.</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Would you at least confirm if those class file are related to JDK 17 and 19? </div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Cheers,</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Martin</div><div>
        ------- Original Message -------<br>
        Le vendredi 20 janvier 2023 à 23:00, Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com" target="_blank">maurizio.cimadamore@oracle.com</a>> a écrit :<br><br>
        <blockquote type="cite">
            
    <p>That is odd - all the functions should be there and generated
      statically - there's nothing dynamic going on.</p>
    <p>That said, I seem to recall that the name of
      "glutIdleFunc$callback" really depends on the version of glut you
      are using. In some the parameter is called "callback" in others is
      called in some other way, so the binding will be diiferent.</p>
    <p>But that doesn't explain the other errors on the more plain
      glutDisplayFunc - those symbols should be there.</p>
    <p>(btw, all of this works on Linux).</p>
    <p>Maurizio<br>
    </p>
    <div>On 20/01/2023 19:09, Martin Pernollet
      wrote:<br>
    </div>
    <blockquote type="cite">

      <div style="font-family:Arial;font-size:14px">Thank you, that
        was indeed confusing but this now "works".</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">One last point
        that I could not figure out is why I can't build this : </div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px"><img alt="image.png" src="cid:185d5108dc9cb971f161"><br>
      </div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">If you don't get
        the image, <a rel="noreferrer nofollow noopener" href="https://urldefense.com/v3/__https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java*L82__;Iw!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8Oin0GzQ$" title="this line of the teapot" target="_blank">this line of the teapot</a> can't build
        saying :</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">glutDisplayFunc#callback
        cannot be resolved</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">I only found in
        generated source glut_h_3</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">
        <p style="margin:0px;font:12px Helvetica;color:rgb(30,181,64)"><span style="color:rgb(204,108,29)">public</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(204,108,29)">static</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(62,171,230)">MethodHandle</span><span style="color:rgb(217,232,247)"> </span>glutDisplayFunc$MH<span style="color:rgb(249,250,244)">()</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(249,250,244)">{</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(18,144,195)"><span style="color:rgb(217,232,247)"><span>        </span></span><span style="color:rgb(204,108,29)">return</span><span style="color:rgb(217,232,247)"> </span>RuntimeHelper<span style="color:rgb(230,230,250)">.</span><span style="color:rgb(150,236,63)"><i>requireNonNull</i></span><span style="color:rgb(249,250,244)">(</span>constants$185<span style="color:rgb(230,230,250)">.</span><span style="color:rgb(141,218,248)"><b><i>glutDisplayFunc$MH</i></b></span><span style="color:rgb(230,230,250)">,</span><span style="color:rgb(23,198,163)">"glutDisplayFunc"</span><span style="color:rgb(249,250,244)">)</span><span style="color:rgb(230,230,250)">;</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>    </span><span style="color:rgb(249,250,244)">}</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(204,108,29)"><span style="color:rgb(217,232,247)"><span>    </span></span>public<span style="color:rgb(217,232,247)"> </span>static<span style="color:rgb(217,232,247)"> </span>void<span style="color:rgb(217,232,247)"> </span><span style="color:rgb(30,181,64)">glutDisplayFunc</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(249,250,244)">(</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(128,242,246)">Addressable</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(121,171,255)">func</span><span style="color:rgb(249,250,244)">)</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(249,250,244)">{</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(150,236,63)"><span style="color:rgb(217,232,247)"><span>        </span></span><span style="color:rgb(204,108,29)">var</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(242,242,0)">mh$</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(230,230,250)">=</span><span style="color:rgb(217,232,247)"> </span><i>glutDisplayFunc$MH</i><span style="color:rgb(249,250,244)">()</span><span style="color:rgb(230,230,250)">;</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>        </span><span style="color:rgb(204,108,29)">try</span> <span style="color:rgb(249,250,244)">{</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>            </span><span style="color:rgb(243,236,121)">mh$</span><span style="color:rgb(230,230,250)">.</span><span style="color:rgb(167,236,33)">invokeExact</span><span style="color:rgb(249,250,244)">(</span><span style="color:rgb(121,171,255)">func</span><span style="color:rgb(249,250,244)">)</span><span style="color:rgb(230,230,250)">;</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>        </span><span style="color:rgb(249,250,244)">}</span> <span style="color:rgb(204,108,29)">catch</span>
          <span style="color:rgb(249,250,244)">(</span><span style="color:rgb(18,144,195)">Throwable</span> <span style="color:rgb(242,242,0)">ex$</span><span style="color:rgb(249,250,244)">)</span> <span style="color:rgb(249,250,244)">{</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(23,198,163)"><span style="color:rgb(217,232,247)"><span>           
            </span></span><span style="color:rgb(204,108,29)">throw</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(204,108,29)">new</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(167,236,33)">AssertionError</span><span style="color:rgb(249,250,244)">(</span>"should not reach
          here"<span style="color:rgb(230,230,250)">,</span><span style="color:rgb(217,232,247)"> </span><span style="color:rgb(243,236,121)">ex$</span><span style="color:rgb(249,250,244)">)</span><span style="color:rgb(230,230,250)">;</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>        </span><span style="color:rgb(249,250,244)">}</span></p>
        <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span>    </span><span style="color:rgb(249,250,244)">}</span></p>
        And no glutDisplayFunc$callback (<span>But this was seamingly
          the same with version 17)</span><br>
        <span></span></div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">Should I expect
        a function to be named this way or is this something dynamic I
        am missing?</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">Any hint
        appreciated :)</div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div style="font-family:Arial;font-size:14px">Martin</div>
      <div style="font-family:Arial;font-size:14px">
      </div>
      <div style="font-family:Arial;font-size:14px"><br>
      </div>
      <div> ------- Original Message -------<br>
        Le vendredi 20 janvier 2023 à 18:59, Maurizio Cimadamore
        <a href="mailto:maurizio.cimadamore@oracle.com" rel="noreferrer nofollow noopener" target="_blank"><maurizio.cimadamore@oracle.com></a> a écrit :<br>
        <br>
        <blockquote type="cite">
          <p>Please, get jextract from here:</p>
          <p><a href="https://urldefense.com/v3/__https://jdk.java.net/jextract/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8IP6L77Q$" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/jextract/</a></p>
          <p>And JDK 19 from here:</p>
          <p><a href="https://urldefense.com/v3/__https://jdk.java.net/19/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8E0vIwhA$" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/19/</a></p>
          <p>These two should work well together.</p>
          <p>The Panama early access binaries are now obsolete, and
            should not be used. In fact, I think it might be time to
            remove them, as they are a constant source of confusion.</p>
          <p>Cheers<br>
            Maurizio<br>
          </p>
          <div>On 20/01/2023 17:54, Martin
            Pernollet wrote:<br>
          </div>
          <blockquote type="cite">
            <div style="font-family:Arial;font-size:14px">Hi all,</div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px">Just tried
              to switch to JExtract samples for JDK 19. I am suprised by
              the fact that the following imports shown in the JExtract
              Teapot sample (on master banch, hence v19) can't be
              resolved</div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px">
              <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span style="color:rgb(204,108,29)">import</span>
                <span style="text-decoration:underline">java</span><span style="text-decoration:underline;color:rgb(230,230,250)">.</span><span style="text-decoration:underline">lang</span><span style="text-decoration:underline;color:rgb(230,230,250)">.</span><span style="text-decoration:underline">foreign</span><span style="color:rgb(230,230,250)">.</span>MemorySession<span style="color:rgb(230,230,250)">;</span></p>
              <p style="margin:0px;font:12px Helvetica;color:rgb(217,232,247)"><span style="color:rgb(204,108,29)">import</span>
                <span style="text-decoration:underline">java</span><span style="text-decoration:underline;color:rgb(230,230,250)">.</span><span style="text-decoration:underline">lang</span><span style="text-decoration:underline;color:rgb(230,230,250)">.</span><span style="text-decoration:underline">foreign</span><span style="color:rgb(230,230,250)">.</span>SegmentAllocator<span style="color:rgb(230,230,250)">;</span></p>
              <br>
            </div>
            <div style="font-family:Arial;font-size:14px">And
              indeed, as shown by this picture, java.lang has no foreign
              subfolder in JDK 19</div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px"><img alt="image.png" src="cid:185d5108dc9cb971f162"><br>
            </div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px">However, I
              found foreign packages to still appear in jdk.incubator
              module.</div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px">May this
              be due to me downloading JDK19 from the panama page? <span><a href="https://urldefense.com/v3/__https://jdk.java.net/panama/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8hi7axdQ$" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/panama/</a></span></div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div style="font-family:Arial;font-size:14px">
              <div> </div>
              <div> Envoyé
                avec la messagerie sécurisée <a rel="noreferrer nofollow noopener" href="https://urldefense.com/v3/__https://proton.me/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS_6VosVXA$" target="_blank">Proton Mail</a>. </div>
            </div>
            <div style="font-family:Arial;font-size:14px"><br>
            </div>
            <div> ------- Original Message
              -------<br>
              Le lundi 2 janvier 2023 à 11:57, Jorn Vernee <a href="mailto:jorn.vernee@oracle.com" rel="noreferrer nofollow noopener" target="_blank"><jorn.vernee@oracle.com></a>
              a écrit :<br>
              <br>
              <blockquote type="cite">
                <p>Hi Martin,<br>
                </p>
                <div>On 23/12/2022 17:20, Martin
                  Pernollet wrote:<br>
                </div>
                <blockquote type="cite">
                  <div style="font-family:Arial;font-size:14px">Hi,</div>
                  <div style="font-family:Arial;font-size:14px"><br>
                  </div>
                  <div style="font-family:Arial;font-size:14px">Would
                    anyone suggest examples showing how to use Panama 19
                    instead of 17? A couple of things have changed (
                    e.g. how to use the new 
                    <pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"><span style="color:rgb(152,118,170)">locator</span>.allocateArray(<span style="color:rgb(204,120,50)">new </span>ValueLayout.OfDouble(</pre>
                    , and deal with all other datatypes, strings, etc).</div>
                </blockquote>
                The general idea is to either use one of the layout
                constants in the ValueLayout class, such as JAVA_DOUBLE.
                Or use a layout generated by jextract for a specific
                type. For strings the type would be a pointer, so the
                ValueLayout.ADDRESS layout or the C_POINTER layout
                generated by jextract can be used for instance.<br>
                <blockquote type="cite">
                  <div style="font-family:Arial;font-size:14px"><br>
                  </div>
                  <div style="font-family:Arial;font-size:14px">One
                    additional question : when will ARM be supported to
                    run panama on Apple M1?  <br>
                  </div>
                </blockquote>
                <p>MacOs/AArch64 (i.e ARM) has been supported since Java
                  17 [1]<br>
                </p>
                <p>Jorn</p>
                <p>[1]: <a rel="noreferrer nofollow noopener" href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/3617__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS-LQIElmg$" target="_blank">https://github.com/openjdk/jdk/pull/3617</a><br>
                </p>
                <blockquote type="cite">
                  <div style="font-family:Arial;font-size:14px"><br>
                  </div>
                  <div style="font-family:Arial;font-size:14px">
                    <div> </div>
                    <div>Regards,</div>
                    <div><br>
                    </div>
                    <div>Martin</div>
                  </div>
                </blockquote>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </blockquote>
        <br>
      </div>
    </blockquote>
  

        </blockquote><br>
    </div></blockquote></div>