How can I prevent java processes from stealing focus?
Eventually I found the basic solution:

For Java applications in general you can specify that they are 'headless', by adding the option -Djava.awt.headless=true to your java application.

(also posted to stackoverflow).