How to jextract

Mitsuru Matsushima m-matsushima at bk.jp.nec.com
Thu Dec 6 10:25:24 UTC 2018


Hi,

I'm trying to jextract with "sys/sysinfo.h" on Ubuntu 18.10.
I want anyone to tell me the right way.

The "sys/sysinfo.h" include sysinfo struct from "linux/sysinfo.h" via "linux/kernel.h".
First, I tried follows, but there was no sysinfo struct in output jar file.

 jdk-12/bin/jextract /usr/include/x86_64-linux-gnu/sys/sysinfo.h

Next, I specified explicitly "linux/sysinfo.h" too.

 jdk-12/bin/jextract /usr/include/x86_64-linux-gnu/sys/sysinfo.h /usr/include/linux/sysinfo.h

But error occured because interface name conflicts.
Then I tried to specify "-m" option to avoid name conflict.
But the mapped classes disappeared in output jar file.
Is this behavior is correct?

Finally, using above behavior, I got two jar with following commands and I could call sysinfo.
But this seems not so nice way.

 jdk-12/bin/jextract /usr/include/x86_64-linux-gnu/sys/sysinfo.h -m /usr/include/linux=linux -t sys -o sys_sysinfo.jar
 jdk-12/bin/jextract /usr/include/linux/sysinfo.h -t linux -o linux_sysinfo.jar

Mitsuru




More information about the panama-dev mailing list