JDK is installed on mac but i’m getting “The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.” sudo apt update

We Are Going To Discuss About JDK is installed on mac but i’m getting “The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.” sudo apt update. So lets Start this Java Article.

JDK is installed on mac but i’m getting “The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.” sudo apt update

  1. JDK is installed on mac but i'm getting “The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.” sudo apt update

    What that update-node-js-version is talking about, is a completely and totally unrelated tool: It's the Advanced Package Tool, which is a tool to manage installations on debian and ubuntu – linux distros. You do not want to run this on a mac, and the instructions you found are therefore completely useless: That is how to update node-js on linux. Your machine isn't linux.

  2. “The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.”

    What that update-node-js-version is talking about, is a completely and totally unrelated tool: It's the Advanced Package Tool, which is a tool to manage installations on debian and ubuntu – linux distros. You do not want to run this on a mac, and the instructions you found are therefore completely useless: That is how to update node-js on linux. Your machine isn't linux.

Solution 1

20 years ago, java shipped with a tool called apt: Annotation Processor Tool. This tool was obsolete not much later.

What that update-node-js-version is talking about, is a completely and totally unrelated tool: It’s the Advanced Package Tool, which is a tool to manage installations on debian and ubuntu – linux distros. You do not want to run this on a mac, and the instructions you found are therefore completely useless: That is how to update node-js on linux. Your machine isn’t linux.

Search around for answers involving brew, which is the go-to equivalent of apt on mac. And completely forget about java – this has NOTHING to do with java – that was just a pure coincidence.

Advertisements

Original Author Of This Content

Solution 2

Install Homebrew on your Mac Machine

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

For the system Java wrappers to find this JDK, symlink it with

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

If you need to have openjdk first in your PATH, run:

echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.profile

For compilers to find openjdk you may need to set:

 export CPPFLAGS="-I/usr/local/opt/openjdk/include"
Advertisements

Original Author Of This Content

Conclusion

Advertisements

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment