#jni

N-gated Hacker Newsngate
2025-05-18

🚀🔧 Ah yes, the classic "let's duct-tape onto Java" strategy—you know, because nothing says "I'm a serious developer" like turning a memory-safe language into a DIY memory management nightmare. 🤦‍♂️ Ever wonder where your weekends went? They're now spent deciphering error messages! 😂
medium.com/@greptime/how-to-su

Darran Lofthousedarranl@fosstodon.org
2025-03-29

For most of my career I have stayed in the Java space and not strayed into native code, recently I have been experimenting with those two worlds coming together include with the new Foreign Function APIs.

This is just a record of my experimentation so far but in case someone finds it useful I have published as a blog post lofthouse.dev/2025/03/29/begin

#Java #Native #JNI #ForeignFunction

Uli Kusterer (Not a kitteh)uliwitness@chaos.social
2025-02-26

#Android friends, how do you unit test your #JNI / #KNI code? Do you write extra KNI glue just so you can trigger internal native methods that call back out into #Kotlin?

Do you restrict yourself to only integration tests and black-box tests and just *not* unit-test this stuff?

All solutions we’ve tried/considered so far kinda feel bad.

(I'm mostly dealing with C/C++ and Kotlin)

2025-02-20

[Перевод] Кофе и крабы. Вызов Rust-кода из Java

Java — один из наиболее часто используемых языков программирования, который мы еще не обсуждали в нашем Rust Interop Guide . В этой статье мы рассмотрим три различных метода вызова кода Rust из Java : JNI , JNR-FFI и Project Panama . Мы покажем различия между этими методами и проведем базовый бенчмаркинг для сравнения их производительности. Эти методы работают не только для Java , но и для других языков JVM, таких как Kotlin . Здесь мы в основном сосредоточимся на Java , но примеры Kotlin доступны в ветке Kotlin нашего репозитория GitHub . Эта статья является частью нашего Rust Interop Guide .

habr.com/ru/articles/884150/

#rust #java #interop #ffi #project_panama #jni #jnr

Uli Kusterer (Not a kitteh)uliwitness@chaos.social
2025-02-13

It has been [0] days since I passed a Java ByteArray object into a C function instead of the GetArrayElements() pointer inside it. #jni

2025-01-30

[Перевод] Java становится надежнее: “Целостность по умолчанию” в действии

Команда Spring АйО перевела статью про ужесточение контроля за динамической загрузкой агентов, ограничения доступа к опасным методам работы с памятью и JNI в новых версиях JDK.

habr.com/ru/companies/spring_a

#java #spring #java_platform #integrity_in_java #jni

2024-11-28

Want to know something odd... ? In the screencast attached you see a single OpenGL-context... the bottom-left part is rendered via Java/lwjgl and the top-right part is rendered via native C++/OpenGL (JNI). Why? Because I can ;) No, there are actually reasons for this :) #C++ #Java #OpenGL #jni

2024-08-29

@fglock @profoundlynerdy We’ve been here before, as far back as 1998 when Larry Wall himself developed the JPL “#Java #Perl Lingo” for @OReillyMedia: github.com/Perl/perl5/blob/per

It was basically a Java code preprocessor that let you inline Perl code in Java methods that could themselves call back to Java via #JNI.

The eventual goal was a Perl-to-Java compiler but it never got there despite distribution with Perl 5.6 through 5.8 as a separate installer.

2024-07-09

JEP 472: Prepare to Restrict the Use of JNI

openjdk.org/jeps/472

#jvm #jni

Sebastian Stenzeloverheadhunter
2024-03-21

contains the final version of the Foreign Function & Memory API (). Being a modern successor to , it allows cool stuff like building Java wrappers arounds C libraries.

We did just that and are proud to announce the first production-ready version of , allowing you to develop filesystems in . It is module-ready, multi-platform, thoroughly tested by @cryptomator and thanks to the FFM API requires no further dependencies.

github.com/cryptomator/jfuse

Pierre Lindenbaumyokofakun@genomic.social
2024-02-19

I'm trying to compile #RStat as a static library with the -fPIC flag (so I can use it within #java #jni), but I cannot find the right flags to compile it this way. I tested various flags but I cannot find the correct syntax.

```
configure.ac:278: error: possibly undefined macro: AM_CONDITIONAL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
```

gist.github.com/lindenb/e8659d

2023-11-19

Wer schon immer mal wissen wollte, wie man aus #Java nativen Code ausführt, hier eine kleine Einführung:
snaums.de/informatik/jni-basic

#JNI

Brændꜵn Mollɔy :ferris:piecritic@hachyderm.io
2023-10-19

Who do I know who can write JNI code in Rust? Brendan needs to call a threading function because omg and I have enough Redmi phones already.

#jni #rust

GripNewsGripNews
2023-09-20

🌗 JEP草案:準備限制JNI的使用
➤ JEP草案介紹了JNI的風險和FFM API的優點,並提供了限制JNI使用的方法。
openjdk.org/jeps/8307341
JEP草案旨在支持默認情況下的完整性目標,通過發出警告來限制通過Java Native Interface(JNI)調用本機代碼。在未來的版本中,除非啟用本機訪問,否則調用本機代碼將導致錯誤。JEP草案的目標是為將來的版本做好準備,限制JNI的使用,以便庫可以通過使用相同的命令行選項從JNI遷移到Foreign Function & Memory(FFM)API。草案還介紹了JNI的風險和FFM API的優點,並提供了限制JNI使用的方法。
+ 這是一個很好的草案,可以幫助Java平臺實現更好的安全性。
+ 限制JNI的使用是一個明智的決定,因為它可以幫助Java平臺更好地保護應用程序的完整性。
Function & Memory API

Fernando Cejas :arch: :linux:android10@fosstodon.org
2023-08-04

After a while working on this, it is finally out!

@rustlang integrated with #Android and @kotlin.

fernandocejas.com/blog/enginee

#AndroidDev #rust #jni #c #kotlin

2023-08-01

Tool of the day: github.com/dg76/signpackage
If you want to notarize your Java app with native libraries for Mac OS.
#notarize #java #jni #macos

2023-05-14

#Swift is a nice language. Having interop between Swift and #C++ would be neat, but with Socket Runtime we would lose out on a lot of code reuse, Windows and Linux are mostly C/C++ code bases, and our Android is mostly C++ via the #JNI, as a result there’s actually very very little #ObjC++ in the project. I’m pretty much +0 on the idea of interop.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst