]> UniFi controller Java versions on Linux 🌐:aligrant.com

UniFi controller Java versions on Linux

Alastair Grant | Monday 7 October 2019

This is not the first time I've had trouble starting Ubiquti UniFi Controller on Linux.  I rarely use the controller in my home network, it's Java so resource intensive and only necessary if I need to reconfigure an access point.  Which is exactly what I wanted to do, but instead I was presented with in my systemd log:

unifi[31974]: WARNING: An illegal reflective access operation has occurred
unifi[31974]: WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$2 (file:/usr/local/bin/unifi/lib/spring-core-3.2.8.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],i>
unifi[31974]: WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$2
unifi[31974]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
unifi[31974]: WARNING: All illegal access operations will be denied in a future release

Seems like something has changed and Java isn't too happy about it.  Indeed, it has, UniFi is only supported on Java 8 - the JRE that won't die and is largely unsupported (Java 13 being the current version at the time of writing).

Still, the fix is relatively easy, you need to install a Java 8 runtime on your system.  This is usually available through your distribution's package manager.  You will then need to narrow down where the new JRE has been installed, in my instance it was: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java

You will need to update your systemd unit file (or whatever you use to launch) to point to the new (sorry, old) version of Java.  e.g.

ExecStart=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java -jar /usr/local/bin/unifi/lib/ace.jar start
ExecStop=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java -jar /usr/local/bin/unifi/lib/ace.jar stop
Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.