Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

467
Views
The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt

I am using M1 Mac OS11.5.2.
I've already downloaded zulu.jdk and zulu.jre, in "/Library/Java/JavaVirtualMachines".
I also exported the PATH.

echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile

When I type

sudo apt update

I get this:

The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.
Please visit http://www.java.com for information on installing Java.

I hope some kind person could tell me the solution.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

APT is for Linux

APT is for Linux, not macOS. Similarly, BSD has their own tools in Packages and Ports.

Homebrew

You can add a similar package-management tool to macOS developed by a third party: Homebrew.

I have not used Homebrew myself, but some folks are big fans.

Manual installers

To install Java, I use an installer app for macOS from Adoptium or Azul Systems, or from any of the several other vendors providing distributions of Java such as BellSoft, Amazon, Microsoft, Oracle, SAP, Red Hat/IBM, Pivotal, etc.

To update I simply:

  • Delete the existing JDK found in /Library/Java/JavaVirtualMachines.
  • Run a freshly-downloaded installer.

This approach is a manual operation. And this requires the Mac’s admin password.

So for mass updates across many computers I can imagine that shell-scripting with Homebrew would be a better solution. If you’d rather not install Homebrew, some vendors are releasing installers that can controlled by a shell script.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!