4

I am trying to install Java version 8 on my MacOS. The installation guideline advises typing this command:

sudo update-alternatives --install /usr/bin/java java /usr/lib/java/JDk.../bin/java

But it returns the following error:

sudo: update-alternatives: command not found

I tried to add the command by typing

brew install update-alternatives

But it gave me another error:

warning: unable to access '/Users/user_name/.config/git/attributes': Permission denied

Any idea of how I can fix this issue?

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
Newcomer
  • 47
  • 1
  • 1
  • 5
  • try `sudo brew install update-alternatives` – Youcef LAIDANI Mar 26 '20 at 08:34
  • 1
    IIRC, update-alternatives is not a MacOS command, but a Linux command. Why do you think you should use update-alternatives? – Mark Rotteveel Mar 26 '20 at 08:41
  • @MarkRotteveel Thanks for your response. Well, firstly just because the guideline says so :) (Ref: https://www.javahelps.com/2015/03/install-oracle-jdk-in-ubuntu.html). Second, because I read somewhere that "it says to your machine to use this alternative of Jave JDK instead of the default one, which, in Linux systems, is OpenJDK", and I previously installed a newer version of Java on my system. Isn't there any replacement of update-ulternatives for Mac? Do you think I could simply skip this command? – Newcomer Mar 26 '20 at 23:57
  • 1
    @Newcomer Those guidelines are aimed at Ubuntu users. Please see: [How to install Java 8 on Mac](https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac) – Steve Mar 27 '20 at 01:57
  • Such a silly mistake I made!!! Thanks for your help :) – Newcomer Mar 27 '20 at 06:13

0 Answers0