That's awesome! If we can support Java 17, it would also be great for us to eventually change the export and packaging model of Maestro from the current ant script to use jpackage instead, so users can get binaries that work for their systems without any java installation being necessary. That was one goal I had in mind with upgrading to java 17.
The code you posted is there to limit Maestro from launching multiple instances. The first instance opens a socket which listens for input, and if Maestro is launched again (e.g. by double clicking on a different midi file in file explorer), it will be unable to open the server socket on the same port, and will instead open a client against that port, send over the details of the file it attempted to open, and exit. The original running Maestro instance will receive the file info in the socket and open the file.
I'm not sure why this wouldn't work on Linux. It's possible the socket is stuck open somehow, might be worth trying a reboot if you haven't already to see if that fixes the problem. We can also maybe look into how some other open source programs with similar functionality (VLC media player comes to mind) achieve this, maybe there is a better way than using sockets. I've also discussed gating this behavior under program settings with Aifel, but that's a separate issue from it not functioning properly on Linux.
Edit: and FYI Maestro is no longer using winrun4j, it seems to be abandonware (due to the introduction of jpackage probably) and Aifel ran into some issues with it when he upgraded Maestro to 64 bit. The current distribution on Windows includes batch scripts which becomes the "executables" for Maestro and ABCPlayer.