How to restart the JBoss manually on Max OSX

Sometimes it is necessary to restart the JBoss, e.g. if the server log file shows a lot of unexplained error messages, and especially if they are related to memory shortage. Here is how to perform this operation:

The first time sudo will prompt for a password.