1

I've just signed up to learn Java: https://www.mooc.fi/en/installation/netbeans

I'm on a Mac (Big Sur - 11.3.1) and so am following point 2.1: https://materiaalit.github.io/tmc-asennus/macos-verkkoongelma/

When running the command:

echo  " 127.0.0.1 $ ( hostname ) "  | sudo make -a / etc / hosts

Terminal spits the following back at me: /Applications/Xcode.app/Contents/Developer/usr/bin/make: invalid option -- a

After looking around on here for a while, I found: this link

I'm not sure if it's related/how to fix it for this specific use case.

Does anyone know what I need to do to fix the error?

The version of X-Code CLI I'm running is xcode-select version 2384.

Huge thanks in advance :)

WillW
  • 11
  • 1
  • The link you provide doesn't contain `sudo make -a`. It does contain `sudo tee -a`. Also, be careful of where you place extra whitespace in your commands. I would expect the path `/ etc / hosts` to be a problem - it should be `/etc/hosts` - no extra spaces. – andrewJames Jun 14 '21 at 14:04
  • Hey @andrewjames, sorry for the confusion. The link isn't the 'exact' same issue. The question being asked in that link is actually for a different program. I referenced it because I thought the issue might be related. Apologies for that. I also suspected the / etc / hosts spacing may cause issues but sadly get the same error. – WillW Jun 14 '21 at 14:17
  • OK - no problem. Trying to run a `make` command using a non-existent flag (`-a`), pointing at `/etc/hosts` seems very strange to me. I don't even know why `make` is involved at all, just to run Java/NetBeans on a Mac. Maybe there is a reason... – andrewJames Jun 14 '21 at 14:47
  • Why are you trying to run `sudo make -a` then? All of the extra spaces may be causing you issues; did you run this command `echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts` and get an error? If so, copy the command run and the error and post both of them. – Joe Casadonte Jun 14 '21 at 17:09

0 Answers0