Linking to macOS frameworks

Clayton Walker clayton.m.walker at
Wed May 19 16:46:30 UTC 2021


I'm working on a project that would let you call objective-c functions from
java, without first needing to wrap the api in a shared library. While this
works for symbols that are already available
(i.e.LibraryLookup.ofDefault().lookup("objc_getClass")), it doesn't work
for symbols that are in another framework.

For example, I would like to be able to write something like this:
// or
however this currently doesn't work. The first call throws with "Directory
separator should not appear in library name", second one throws with
"Library not found".

I've been able to work around this by using dlopen
MemoryAddress l1;
try (var c =
    l1 = (MemoryAddress) dlopen.invokeExact(c.address(), 1);
but this seems rather strange. It looks like LibraryLookup.ofPath requires
the path to exist, whereas in Big Sur the files no longer exist (via

More information about the panama-dev mailing list