<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2023, at 8:54 AM, Michael Hall <<a href="mailto:mik3hall@gmail.com" class="">mik3hall@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Feb 16, 2023, at 11:54 AM, Michael Hall <<a href="mailto:mik3hall@gmail.com" class="">mik3hall@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Feb 15, 2023, at 5:36 PM, Michael Hall <<a href="mailto:mik3hall@gmail.com" class="">mik3hall@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Exception in thread "FileSystemWatcher" Exception in thread "FileSystemWatcher" java.lang.InternalError: platform encoding not initialized</span></div></blockquote></div><br class=""><div class="">I had to add a JNI_OnLoad to resolve jvm references which seemed to work. Initializing the encoding from there also seems to work.</div><div class="">The code now in fact does seem to work. Not a lot of debugging required. </div><div class="">I’ll try to get my GitHub project updated with maybe improved markdown.</div><div class="">But for me, now with mine, this seems to work just fine.</div></div></div></blockquote></div><br class=""><div class="">Still a little thrown together but I have updated my GitHub project for this.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/mik3hall/trz" class="">https://github.com/mik3hall/trz</a></div><div class=""><br class=""></div><div class="">My original code is a custom default FileSystemProvider. It is almost all pass through except I added some OS/X specific FileAttributeView’s for file related native api's. For your code this means you are basically a plugin WatchService replacing the default platform polling one for whatever jdk you choose to use it on. No other actual changes to the platform provider are involved.</div><div class="">This jdk needs to include the module jdk.incubator.foreign. I used MemoryAddress to replace the use of Unsafe getInt. A possible way around this, reverting my changes, is mentioned in the README. As are other details of what I remembered needed changing to go from a runtime based implementation to a jni one. </div><div class="">I also detail some of what the original code did.   </div><div class=""><br class=""></div><div class="">I have test now with the nio Move, Basic, and a modified extra heavy duty LotsOfEvents. It seems to work fine. Surprisingly easily. </div><div class=""><br class=""></div><div class="">So, this should mean you or anyone else who wants to can try this out against any recent openjdk version.</div><div class=""><br class=""></div><div class="">If anyone does, I would of course be interested in hearing about it. Especially if there are any problems related to what I’ve done.</div></div></div></blockquote><br class=""></div><div>And to possibly make it a little easier for anyone who does want to try it I added a release for the first time.</div><div>This just contains the jar (non-modular), dylib, and a sample invocation.</div><div>All it takes.</div><br class=""></body></html>