Unable to locate a Java Runtime that supports apt

while running any command i am getting this error on my mac.I have installed java jdk but still getting this issue how to fix it any help will be great

this is my Java version details

MacBook Air 13″, macOS 11.3

Posted on Jun 8, 2021 6:26 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 8, 2021 7:12 AM

Although there is a /usr/bin/apt in macOS Big Sur, there is no documentation available via man page, or command-line switches (-h | --help) that would confirm that it has the same functionality as apt on Linux.


In the past, it seemed to me that the JRE (Java runtime) was bundled with the JDK download, and should be present with your installation of Java 16.0.1. Perhaps not, which may imply that you need that same JRE version installed to satisfy the apt command, or that the apt command may have been blinded by a hardcoded Java version expectation.


Upon performing strings on the /usr/bin/apt application, it does not support the Linux apt command set:


strings /usr/bin/apt | more -r


You may also need to set JAVA_VERSION in your environment.

1 reply
Question marked as Top-ranking reply

Jun 8, 2021 7:12 AM in response to rahulsharmaah

Although there is a /usr/bin/apt in macOS Big Sur, there is no documentation available via man page, or command-line switches (-h | --help) that would confirm that it has the same functionality as apt on Linux.


In the past, it seemed to me that the JRE (Java runtime) was bundled with the JDK download, and should be present with your installation of Java 16.0.1. Perhaps not, which may imply that you need that same JRE version installed to satisfy the apt command, or that the apt command may have been blinded by a hardcoded Java version expectation.


Upon performing strings on the /usr/bin/apt application, it does not support the Linux apt command set:


strings /usr/bin/apt | more -r


You may also need to set JAVA_VERSION in your environment.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to locate a Java Runtime that supports apt

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.