News for hackers. Stuff that matters.
Re:How to Use the Foreign Function API in Java 22 to Call C ... by pron on Wednesday May 08, 2024 @01:28PM (#40300722)
The recommended distribution model for Java applications is a jlinked runtime image [1], which supports including native libraries in the image.

[1]: Technically, this is the only distribution model because all Java runtimes as of JDK 9 are created with jlink, including the runtime included in the JDK (which many people use as-is), but I mean a custom runtime packaged with the application.

Re:How to Use the Foreign Function API in Java 22 to Call C ... by maksut on Wednesday May 08, 2024 @02:27PM (#40301398)
Is that still true when distributing libraries?
Re:How to Use the Foreign Function API in Java 22 to Call C ... by brabel on Wednesday May 08, 2024 @04:12PM (#40302347)
Absolutely not. jlink is used to distribute applications (it includes your code, the Java libs you use, i.e. their jars, and the trimmed-down JVM with the modules you're using so that your distribution is not so big - typically around 30MB).

Java libraries are still obtained from Maven repositories via Maven/Gradle/Ant/Bazel/etc.

Re:How to Use the Foreign Function API in Java 22 to Call C ... by pron on Wednesday May 08, 2024 @03:24PM (#40301918)
If you distribute libraries as jmod files, which few libraries do (in that case, jlink would automatically extract the native libraries and place them in the appropriate location).