Unable to load java runtime environment mac unifi

ubiquiti-unifi-controller — open /Applications/UniFi.app shows «Unable to load Java Runtime Environment.»

I installed ubiquiti-unifi-controller . It pointed me at installing homebrew/cask-versions/adoptopenjdk8 , which I also did. However, on launch, the application presents the following error:

Unable to load Java Runtime Environment

This could be the same issue as #1577.

Command that failed

$ brew cask install homebrew/cask-drivers/ubiquiti-unifi-controller $ brew cask install homebrew/cask-versions/adoptopenjdk8 $ /Applications/UniFi.app/Contents/MacOS/JavaAppLauncher 2020-08-17 17:19:27.575 JavaAppLauncher[17562:309796] Searching for a JRE. 2020-08-17 17:19:27.576 JavaAppLauncher[17562:309796] JRE search exception: 'launch path not accessible' 2020-08-17 17:19:27.576 JavaAppLauncher[17562:309796] Could not find a JRE. Will look for a JDK. 2020-08-17 17:19:27.646 JavaAppLauncher[17562:309796] No JDK 1.7 or later found. 

Output of command with —force —verbose —debug

Output of brew cask doctor

==> Homebrew Version 2.4.11 ==> macOS 10.15.6 ==> SIP Enabled ==> Java N/A ==> Homebrew Cask Staging Location /usr/local/Caskroom ==> Homebrew Cask Taps: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3637 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (159 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (1545 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (157 casks) ==> $LOAD_PATHS /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-macho-2.2.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-rspec-1.42.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.7.1/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rexml-3.2.4/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/plist-3.5.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/patchelf-1.2.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/mechanize-2.7.6/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/elftools-1.1.2/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/ /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/bindata-2.4.8/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.3.2/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.4.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/tzinfo-1.2.7/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/thread_safe-0.3.6/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/i18n-1.8.5/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.7/lib/concurrent-ruby /Library/Ruby/Site/2.6.0 /Library/Ruby/Site/2.6.0/universal-darwin19 /Library/Ruby/Site /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin19 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19 /usr/local/Homebrew/Library/Homebrew ==> Cask Environment Variables: BUNDLE_PATH CHRUBY_VERSION GEM_HOME GEM_PATH HOMEBREW_CASK_OPTS LC_ALL PATH RBENV_VERSION RUBYLIB RUBYOPT RUBYPATH SHELL 

Output of brew tap

homebrew/cask homebrew/cask-drivers homebrew/cask-fonts homebrew/cask-versions homebrew/core 

Источник

Читайте также:  Html button style font color

UniFi Controller on MacOS fails to start

When trying to launch the app, I get an error of Unable to load Java Runtime Environment :

unifi-controller-cannot-load-java-jre01

This is after upgrading from an older version. The UniFi team’s response is:

We stopped bundling Java as of UniFi Network 5.11.47. If you’re installing that release or later please make sure you have manually installed a current release of Java 8 beforehand. Only the Java Runtime Environment (JRE) is required. Oracle JRE 8 offers the simplest path as it will simply “just work” without requiring any changes. We may investigate alternative JVMs and update this message accordingly.

  • Java 8 is required for the controller
  • they stopped bundling Java 8 in the MacOS controllers since 5.11.47
  • Java 9 or newer is not supported

They ask you to go to https://www.java.com/en/download/ and download the Oracle JRE. At the time of this writing:

Recommended Version 8 Update 281 (filesize: 80.67 MB)
Release date January 19, 2021

Requiring Oracle Java is a mistake for business users, or any commercial use that requires Oracle Java. When Oracle changed the licensing model for Java, the licensing cost and compliance costs for business / commercial users got very expensive.

There are good and better Java distributions, including OpenJDK, AdoptOpenJDK and Amazon AWS Corretto.

OpenJDK 11 and OpenJDK 8 are the current long-term support releases. Requiring Oracle Java 8 is a mistake. If there is a technical reason in the Unifi implementation that somehow requires Oracle Java, that’s even more concerning.

1000s or 10000s of companies have already moved to OpenJDK or Corretto to avoid the licensing costs of Oracle Java. There is no advantage to using Oracle Java. OpenJDK is source-code compatible, and Corretto incorporates bug fixes and performance enhancements in addition to being compatible.

Solution 1

Start with installing Homebrew following the instructions on https://brew.sh/ and install a Java version you like, e.g.:

$ brew install corretto8 # or openjdk@8 or adoptopenjdk8 

Then install the start-up script ~/bin/unifi.sh (also works with any other Java 8):

#!/bin/bash ### # Start the Unifi Launcher App with an alternative JDK # because Ubiquity fucked it up with Oracle's JDK # INFO: # https://community.ui.com/questions/Unifi-Controller-5-11-50-on-Mac-OS-X-Catalina-fails-to-start-/2fde6f63-b0ac-43a0-83f7-5cf43ba3d40f?page=1 ### SCRIPT_NAME=$(basename $0) LOCK_FILE="/tmp/$SCRIPT_NAME%.sh>.lock" UNIFI_LAUNCHER="/Applications/UniFi.app/Contents/Resources/lib/ace.jar" _info()  MY_MESSAGE=$@> echo -e "$(/bin/date) $SCRIPT_NAME> $$ INFO: $MY_MESSAGE>" > _error()  MY_MESSAGE=$@> echo -e "$(/bin/date) $SCRIPT_NAME> $$ ERROR: \ could not execute: $MY_MESSAGE>" exit 1; > # set a lock file. if ( set -o noclobber; echo "$$" > "$LOCK_FILE>") 2> /dev/null ; then trap 'rm -f "$"; exit $?' INT TERM EXIT else _error "Another instance of $SCRIPT_NAME> is already running!" fi ### CMD="$(/usr/libexec/java_home -v 1.8)/bin/java -jar $UNIFI_LAUNCHER> ui" _info "$CMD>" ( eval $CMD> ) || _error "$CMD>" 

Solution 2

This solution requires you to modify the UniFi app files.

Link a Java installation to the UniFi.app:

$ sudo ln -s \ /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/ \ /Applications/UniFi.app/Contents/PlugIns/adoptopenjdk-8.jdk 

The next step is to tell the UniFi.app to use that by editing the /Applications/UniFi.app/Contents/Info.plist .
Add the JVMRuntime after the JVMOptions :

 JVMRuntime adoptopenjdk-8.jdk 

After the update you should be able to start the app like any other app.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubiquiti-unifi-controller — open /Applications/UniFi.app shows «Unable to load Java Runtime Environment.» #1700

ubiquiti-unifi-controller — open /Applications/UniFi.app shows «Unable to load Java Runtime Environment.» #1700

Comments

General troubleshooting steps

  • I understand that if I ignore these instructions, my issue may be closed without review.
  • I have retried my command with —force .
  • I ran brew update-reset && brew update and retried my command.
  • I ran brew doctor , fixed as many issues as possible and retried my command.
  • I have checked the instructions for reporting bugs.
  • I made doubly sure this is not a checksum does not match error.

Description of issue

I installed ubiquiti-unifi-controller . It pointed me at installing homebrew/cask-versions/adoptopenjdk8 , which I also did. However, on launch, the application presents the following error:

Unable to load Java Runtime Environment

This could be the same issue as #1577.

Command that failed

$ brew cask install homebrew/cask-drivers/ubiquiti-unifi-controller $ brew cask install homebrew/cask-versions/adoptopenjdk8 $ /Applications/UniFi.app/Contents/MacOS/JavaAppLauncher 2020-08-17 17:19:27.575 JavaAppLauncher[17562:309796] Searching for a JRE. 2020-08-17 17:19:27.576 JavaAppLauncher[17562:309796] JRE search exception: 'launch path not accessible' 2020-08-17 17:19:27.576 JavaAppLauncher[17562:309796] Could not find a JRE. Will look for a JDK. 2020-08-17 17:19:27.646 JavaAppLauncher[17562:309796] No JDK 1.7 or later found. 

Output of command with —force —verbose —debug

Output of brew cask doctor

==> Homebrew Version 2.4.11 ==> macOS 10.15.6 ==> SIP Enabled ==> Java N/A ==> Homebrew Cask Staging Location /usr/local/Caskroom ==> Homebrew Cask Taps: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3637 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (159 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (1545 casks) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (157 casks) ==> $LOAD_PATHS /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-macho-2.2.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-rspec-1.42.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.7.1/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rexml-3.2.4/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/plist-3.5.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/patchelf-1.2.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/mechanize-2.7.6/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/elftools-1.1.2/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/ /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/bindata-2.4.8/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.3.2/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.4.0/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/tzinfo-1.2.7/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/thread_safe-0.3.6/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/i18n-1.8.5/lib /usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.7/lib/concurrent-ruby /Library/Ruby/Site/2.6.0 /Library/Ruby/Site/2.6.0/universal-darwin19 /Library/Ruby/Site /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin19 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19 /usr/local/Homebrew/Library/Homebrew ==> Cask Environment Variables: BUNDLE_PATH CHRUBY_VERSION GEM_HOME GEM_PATH HOMEBREW_CASK_OPTS LC_ALL PATH RBENV_VERSION RUBYLIB RUBYOPT RUBYPATH SHELL 

Output of brew tap

homebrew/cask homebrew/cask-drivers homebrew/cask-fonts homebrew/cask-versions homebrew/core 

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью