Skip to main content

Java

Java version is too old or missing

Both launchers validate the Java installation on every start. If a service exits immediately, check the journal:

sudo journalctl -u msh-zr-milter.service

The following messages identify the problem:

  • Java <version> detected. Java 21+ is required. - the resolved java binary is older than 21.
  • MSH_JAVA_BIN ('java') does not point to a valid executable. - Java is not installed, or not on the PATH visible to systemd services.

To fix it, install Java 21 or later (see the Java installation guide), or point the application at an already installed Java 21 binary by setting the absolute path in etc/config.cf:

/opt/msh-zr/etc/config.cf
MSH_JAVA_BIN=/usr/lib/jvm/java-21-openjdk-amd64/bin/java

Then restart the services:

sudo systemctl restart msh-zr-milter.service msh-zr-web.service

Memory allocation

By default, the application uses the following Java heap size settings:

  • Minimum heap size: 128MB
  • Maximum heap size: 1024MB

If your environment requires different values, you can override them by editing /opt/msh-zr/etc/config.cf and adding:

/opt/msh-zr/etc/config.cf
JAVA_XMS=128M
JAVA_XMX=1024M

Where JAVA_XMS sets the minimum heap size and JAVA_XMX sets the maximum. Adjust the values as needed. The settings apply to both services.

After making changes, restart the services to apply them:

sudo systemctl restart msh-zr-milter.service
sudo systemctl restart msh-zr-web.service