I couldn’t log in anymore on my Unifi Controller after updating the controller on my Raspberry Pi to version 5.10.12. All I got was a blank screen 🙁
After some digging around I noticed that Java needed to be updated. Rasbian is shipped with an outdated version of Java and for the Unifi Controller, we need at least version 1.8.0_201. So in this article, I am going to explain how you can update the Raspberry Pi Java version.
We are going to update Java on the PI. The problem is that the latest versions of Java aren’t available in the default repositories for Raspbian. So we need to add the correct repository manually to update Java.
Login to your PI with Putty or your preferred CLI (command-line interface) tool. First remove the OpenJDK:
sudo apt-get purge openjdk*
Add a digital key so we can authorize the repository
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
Add the packet source
sudo vim /etc/apt/sources.list
Add the repository
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
Install the latest version of Java 8
sudo apt-get update sudo apt-get install oracle-java8-installer sudo apt-get install oracle-java8-set-default
Remove the old Java version
sudo apt-get purge openjdk* sudo apt-get purge java7* sudo apt-get autoremove
Check if we have the latest version of Java:
java -version #java version "1.8.0_201"
Your Java Version on your Raspberry Pi should now be updated to the latest version. If you have the Unifi Controller running on it, all you need to do is reboot the Pi (sudo reboot).