Fork me on GitHub
#graalvm
<
2020-04-29
>
borkdude22:04:23

I need an example how to return a String (or CCharPointer to a String) from a native Graal library and how to read it from Java (or another Graal native application for that matter. I have tried this: https://github.com/borkdude/babashka/blob/7e31aedaff0d19caa8bb55f57636dc8b3ee8f0ce/libhsqldb/src/org/babashka/LibHsqlDb.java#L15 for the library and this for the program calling that library: https://github.com/borkdude/babashka/blob/7e31aedaff0d19caa8bb55f57636dc8b3ee8f0ce/src-java/org/babashka/LibHsqlDb.java#L4 but this results in a fatal error: https://github.com/borkdude/babashka/issues/397#issuecomment-621481269 I'm not so familiar with all this JNI stuff, so any help would be appreciated.

gklijs09:04:22

Does it really needs to be a String? String's have some weird things, I think a char array would be simpler?