It can be compiled to a JAR file, but as noted, you’ll need a Java Runtime Environment (JRE) on the user’s machine to execute it. This is fairly common, and easy enough to point a user to a JRE installer if they don’t have it.
The second issue is whether the code is exposed in such a way that it can be run from a command line or it’s just a pure Java library function. If it is the first (it’s already encapsulated as a main() function), it’s easy to run the process via the shell from Xojo. If it is the latter, you’d have to wrap the function with some code that exposes it as something that can be called from the command line, and then you are good to go. This would be akin to writing a main() in C, getting the command line arguments, and calling the method in question. There are many examples of this that you could copy/paste the code for, and some libraries that can be used, as well. This tutorial shows how to do it and includes some links to libraries, for example: Command-Line Arguments in Java | Baeldung . But, again, it’s not completely stand alone as you would need a JRE on the user’s system.