Java Home Directory Fail Issue on Ubuntu – RESOLVED

Java Home Directory Fail Issue on Ubuntu – RESOLVED

For those of you who’re building your Ubuntu from scratch or even if you did like me and install UniFi on an AirVision NVR, , you might or might not get this after installing UniFi Controller

*Setting Java Home….fail

If that do happen, this might be because since the new Ubuntu, the name of the Java homedir changed according to the CPU architecture used and UniFi is using a hard-coded variable for the Java path in its startup script for some reason. You should change the homedir by editing the init script. (We won’t get into much detail about what is init)

1. Open the init script
sudo nano /etc/init.d/unifi

2. Scroll down with your arrow key, look for a variable called

3. Add your instance architecture type after that string.
For example, I’m using amd64bit in my instance, the string should become
DO NOT touch anything else.

4. After the edit just enter Ctrl-X and it will ask you wheter it should save or discard the change. We of course want to save it. Press Y, and press ENTER to save it with the same file name. The nano editor will close

5. Do this string to restart our UniFi Controller.
sudo service unifi restart

6. You suceed when you see
* Starting Ubiquiti UniFi Controller unifi [ OK ]

Steve Discher

Steve Discher was born in Apple Valley, California and today makes his home in College Station, Texas with his wife and three children. He is a 1987 graduate of Texas A-M University and owns ISP Supplies, a wireless distribution company, and conducts MikroTik training classes. His hobbies include flying his Piper Cub and RV camping with his family.

Recent Posts

  • Using MikroTik LHG as a UE With a Baicells eNodeB

    This has been a dream for a long time, and a DIY project for those industrious individuals willing to cobble it together, but now it is a reality in a production device. First of all why would you want to …

  • New ISP Supplies App

    Now available on the Playstore and the iPhone Appstore, the ISP Supplies App! With great features like a powerful search engine and a reorder list, it makes it fast and easy to place orders on the go. Favorite products for quick …

  • Update: Block Countries Based on IP Addresses and Networks

    If you never used my web site to build firewalls and QOS, you have been working too hard! I recently (today) updated the database of IP addresses by Country to generate MikroTik IP Address Lists by country. Check it …

See More News