If you use Zimbra Collaboration Suite you could use Java environment embedded with suite. No need to install separate Java package. Only Zimbra 8.7 and later is supported.
On the command line, type (with root privileges):
yum -y install java-1.8.0-openjdk
Go to https://java.com/en/download/linux_manual.jsp web site and download JRE tarball based on your processor architecture (32-bit or 64-bit).
You should have downloaded
jre-8u101-linux-XXXX.tar.gz file (update version can be different, here u101). Copy one of these files to you mail server.
Unpack the tarball:
tar zxvf jre-8u101-linux-x64.tar.gz
Move extracted files to
/opt directory (as root):
mv jre1.8.0_101 /opt
Change owner of the
/opt/jre1.8.0_101 directory (as root):
chown -R root:root /opt/jre1.8.0_101
Create symbolic link for easier use (as root):
ln -s /opt/jre1.8.0_101/ /opt/jvm
Now PATH environment variable need to be configured. Create a file
/etc/profile.d directory and put below content to it (as root):
To apply changes to current session you need to relogin or invoke command:
/etc/environment file and add the following line:
<PATH_TO_JRE> is different between distributions, so you need to verify your path. Below are two examples from popular distributions, one from manual installation and Zimbra.
Red Hat Linux, CentOS, Fedora, Oracle Linux, etc.
Debian, Ubuntu, etc.
Zimbra 8.7 and later
So if you would like to use manual installation path, line in
/etc/environment file should look like this:
With Zimbra installation, like this:
To apply environment file invoke command:
To check if Java is working run command:
If everything is OK, you should get result like this:
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Application by default uses standard sizes for Java memory usage. Minimal size is set to 128MB and maximum to 1024MB, if needed these two values can be changed.
/opt/msh-ds/etc/config.cf file and add these two lines:
Where JAVA_XMS is minimal size of memory usage and JAVA_XMX is maximum. After change restart application services: