<div dir="ltr">Hi Lev,<div><br></div><div>Others have already answered your question. However, as a supplement: if you want to get the complete filename of a library in a cross-platform way, </div><div>you can use <font face="monospace">System.mapLibraryName(String)</font>.</div><div><br></div><div>For example, when you call <font face="monospace">System.mapLibraryName("a")</font>, you will get:</div><div><ul><li>Windows: a.dll</li><li>Linux: liba.so</li><li>macOS: liba.dylib</li></ul><div>Glavo</div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jan 29, 2026 at 11:14 PM Lev Serebryakov <<a href="mailto:lev@blacklion.dev">lev@blacklion.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
  I wonder, is there best practices for `SymbolLookup.libraryLookup()`? <br>
<br>
  I mean, in POSIX-like systems it look in system directories and I can simply pass `"libname"` as argument. But on Windows it doesn't work even with `-Djava.library.path` which points do directory with `libname.dll`, looks like I need ".dll" to name.<br>
<br>
  Check for OS via property "<a href="http://os.name" rel="noreferrer" target="_blank">os.name</a>" looks like bad solution: maybe, on other systems, which I'm not ware about, I need add other extension, and my code which check will fails!<br>
<br>
  And I cannot understand what should I pass in MacOS. I've tried "name", "libname", "libname.dylib" — nothing works. Library file is "libname.dylib" in directory passed as `-Djava.library.path". <br>
<br>
  Is here better and future-proof way?<br>
<br>
  I can copy code from JNA, but I don't like it very much, to be honest.<br>
<br>
Thnak you.<br>
<br>
-- <br>
// Lev Serebryakov<br>
</blockquote></div>