You’ll probably get burned for this kind of question, but its a super cool thing to implement and its completely possible
In terms of your java action, implement it as general as possible
You can implement this in a more general way.
This way can do the cool stuff local or remote with way faster testing cycles. With the request handler set up you can execute just about anything, including setting up virtualenv, pip, etc and execute shell scripts or binaries via GET or POST, even build your own programs with GCC or some other tool (which you can also build if it does not exist)
We've recently had a very similar question, which you can find here.
To summarize: ensure the program can run in your deployment environment (.exe won't run in the standard Mendix cloud, as that is hosted on Linux) and package your program and script in the resources folder.
Ockert's answer might be a nice addition, but just getting the script to run is a non-trivial step.