info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

UniFi - How to Configure a Debian/Ubuntu Controller to use Oracle Java

Overview


This article will guide those administrators who are using the UniFi controller on a Debian/Ubuntu server and want to use Oracle Java instead of the default OpenJDK. It will also explain when UniFi needs to be re-configured.

Install with JavaPackage


The recommended method to install Java as to avoid any issue with version detection in UniFi is by using the JavaPackage tool as explained and outlined here.

Installing properly via this method should require no manual configuration with the UniFi controller. 

Configuring UniFi to Work with Other Installation Methods


If Oracle Java version is installed with a different method than the one listed above, you will need to configure UniFi to work properly. This configuration should be persistent across upgrades of the UniFi controller so will only need to be done once. 

To do this, you simply need to define the JAVA_HOME location on your Debian/Ubuntu server:
Note: This will vary based on version- change JAVA_HOME path as needed.

echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle" | sudo tee -a /etc/default/unifi

Related Articles