1

Important : I use apt instead of brew for some softwares aren't available.eg: Wireguard,hping3. Already answered similar questions say dont use apt..But surely I need apt.

Java is configured properly still apt install doese'nt works. Apple M1 Pro chip. I installed JDK and I setup its JAVA_HOME manually. Normal Java program runs good.

joy@JOYs-MacBook-Pro ~ % source .bash_profile

joy@JOYs-MacBook-Pro ~ % apt install wireguard

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.

joy@JOYs-MacBook-Pro ~ % echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home

joy@JOYs-MacBook-Pro ~ % java -version
java version "17.0.1" 2021-10-19 LTS Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39) Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

joy@JOYs-MacBook-Pro ~ % javac -version
javac 17.0.1

joy@JOYs-MacBook-Pro ~ %cat .bash_profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home%

joy@JOYs-MacBook-Pro ~ % ls -al | grep bash

-rw------- 1 joy staff 1722 Dec 6 07:46 .bash_history

-rw-r--r-- 1 joy staff 79 Dec 6 07:28 .bash_profile

  • Don't close this question. The similar questions in stackoverflow only say to use brew. The problem brew don't have all software of apt.. So I need answer for using apt :) – JOY SAM RAJ Dec 08 '21 at 07:47
  • Even if this is off-topic here (as it is not related to programming): why did you use `apt` on a Mac system? That is a tool for Debian-based systems. How did you install it after all? – Nico Haase Dec 15 '21 at 17:08
  • By default all Mac has apt installed... But the problem is ..It says JDK is misconfigured for all M1 mac's. Thats the issue to be solved by Apple or StackOverflow – JOY SAM RAJ Dec 28 '21 at 11:30
  • Well, usually apt does not need a JDK, as the package manager apt is not written in Java. Even https://stackoverflow.com/questions/66267454/jdk-is-installed-on-mac-but-im-getting-the-operation-couldn-t-be-completed-un lists that the apt on your Mac is a completely different tool under the same abbreviation – Nico Haase Dec 28 '21 at 13:33
  • Yeah agree.. Let me ask the apple support – JOY SAM RAJ Dec 29 '21 at 17:33

0 Answers0