Basic questions about Panama

Henry Jen henry.jen at oracle.com
Wed Mar 14 20:41:39 UTC 2018


Hi Virendra,

> On Mar 14, 2018, at 12:09 PM, Virendra J. Marathe <virendra.marathe at oracle.com> wrote:
> 
> 
> Hi all,
> 
> I've started working on a project in Oracle Labs to enable persistent memory access in Java
> through Panama.  I'm new to Panama.  I'm using the nicl branch, which I was told contains
> the jextract tool to create Java classes from .h files (the code is in C).  I have a couple
> questions to get started.
> 
> 1. Samples: README.nicl says sample programs should be present in the src/demo/share/panama
>   directory.  I don't see that directory in either the nicl branch or the default one.

We are moving demos into test, I’ll update README.nicl. It is now in jdk/test/java/nicl and jdk/test/com/sun/tools/jextract.

A sample to show how jextract generate binding for libclang and run jextract on top of the generated classes can be found at
http://cr.openjdk.java.net/~henryjen/panama/clang-ffi/

That is a little out-of-date, a new version will come up soon.

> 2. Is there a tool present in Panama to get a .java version of the classes created by
>   jextract?  (Perhaps the missing samples will help with this one?)
> 

Currently we only generate class files, not source files. Generated stub are interfaces and implementation classes are weaved at runtime.

Cheers,
Henry



More information about the panama-dev mailing list