0

I have a LABISTS Raspberry Pi 4 B Model B 4GB with Raspbian 10 installed (Buster). I've been trying to follow UniFi - How to Install and Update via APT on Debian or Ubuntu to install the Ubiquiti UniFi Network Controller to monitor my WiFi network, which uses a Ubiquiti access point. Unfortunately this software requires Oracle Java 8.

I've found various articles from a couple of years ago (e.g. UVC-NVR and JDK 1.8) which rely on oracle-java8-installer from webupd8team, but unfortunately this installation method is no longer available. I found this SO answer - E: Package 'oracle-java8-installer' has no installation candidate - which describes part of the manual installation process.

How do I complete the process?

1

I got it working so thought I would share the steps, some of which are similar to the steps in E: Package 'oracle-java8-installer' has no installation candidate.

  1. Create an Oracle account

  2. From the Oracle download page, download the Linux ARM v6/v7 Soft Float ABI 32bit version of Java because it's likely that you have a 64-bit kernel but 32-bit userland. Example: jdk-8u202-linux-arm32-vfp-hflt.tar.gz

  3. Log in as root: sudo -i

  4. Extract the tarball: tar -zxf jdk-8u202-linux-arm32-vfp-hflt.tar.gz -C /usr/lib/jvm

  5. Link the correct name (required by the /etc/init.d/unifi startup script): cd /usr/lib/jvm; ln -s jdk1.8.0_202 jdk-8-oracle-arm32-vfp-hflt

  6. Optional, not required by UniFi: Set JAVA_HOME for all users: echo "export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt" > /etc/profile.d/java.sh

  7. Install the new versions of Java (JDK and JRE, because the JRE is the one that the init.d script looks for):

     update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java 100
     update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java 110
    

Now I can run the command I wanted to run in the first place: service unifi start

Then I can access the web interface on http://<IP address of Pi>:8080.

I hope this answer helps you to install Oracle Java 8 on their Raspberry Pi, especially if you're trying to install it so that you can run UniFi Network Controller!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.