How do I run rmiregistry and RMI servers in the background under Windows?

Govind Seshadri

You can start rmiregistry or RMI servers from a DOS window under Win32 using the start command. But this does not run your servers truly in the background, as a little DOS window for the java interpreter remains in the foreground for each server that is started. If you are starting numerous remote servers under Win32, all the DOS windows could prove rather problematic.

A solution is to use the javaw command that is supplied as part of the Windows JDK/SDK. This fires up the Java interpreter as a seperate process and runs your RMI server in the background. This effectively eliminates the clutter of DOS windows in the foreground for each of your RMI servers.

Do note that there are some downsides to using javaw. For instance, it is no longer that simple to terminate a running Java process - you now have to do it via the task manager. Also, if you are in debugging mode, you will not be able to see any of the diagnostic messages sent to the console, as it is now in the background.