Re:How to Use the Foreign Function API in Java 22 to Call C ...
by brabel on Wednesday May 08, 2024 @04:15PM
(#40302373)
I remember using Sqlite Java and not having to install sqlite on the image. Then I looked inside the Sqlite-java's jar and they just packed the sqlite binaries for the different OSs in the jar!!
[ Parent
| on HN ]
Re:How to Use the Foreign Function API in Java 22 to Call C ...
by DannyB2 on Wednesday May 08, 2024 @04:32PM
(#40302495)
I once (2016 ish) used a serial-port library for Java. Needed to be cross platform desktop app for Linux, Windows and Mac (in that order, all on x86/64). And it was. I have forgotten the name of the library project I included, but it included DLL binaries for the platforms we were targeting.
Re:How to Use the Foreign Function API in Java 22 to Call C ...
by dehrmann on Thursday May 09, 2024 @01:38AM
(#40305579)
Not sure if this is still the case, but one of the Java Sqlite driver used something called NestedVM to run Sqlite in the JVM when a native library wasn't available. It worked by cross-compiling the code to mips, then transpiling the mips assembly to Java byte code. I can't remember if it bridged system calls or libc calls to Java for things like file IO.
Re:How to Use the Foreign Function API in Java 22 to Call C ...
by KptMarchewa on Thursday May 09, 2024 @05:55AM
(#40306658)
That's a common solution. I do the same.