Question:
➜ ~ mvn
zsh: command not found: mvn
Answer:
step 1:
vim ~/.zshrc
step 2:(Add at the end of the file)
source ~/.bash_profile;
step 3:(Execution shell)
> source ~/.bash_profile
You can use mvn :
➜ / mvn
[INFO] Scanning for projects...
.......
Answer from sunmeilinbbs on Stack Overflowmacos - Mac command line: zsh: command not found: mvn - Stack Overflow
Terminal zsh:killed - Apple Community
macos - Maven commands resuting in Killed: 9 on MAC OS - Stack Overflow
macos - How to fix "Killed: 9" error in mac os? - Ask Different
Question:
➜ ~ mvn
zsh: command not found: mvn
Answer:
step 1:
vim ~/.zshrc
step 2:(Add at the end of the file)
source ~/.bash_profile;
step 3:(Execution shell)
> source ~/.bash_profile
You can use mvn :
➜ / mvn
[INFO] Scanning for projects...
.......
Just add:
source ~/.bash_profile
to .zshrc
Open a new terminal window/tab
If you replace a signed macOS binary by using cp instead of mv then macOS caches the signature, doesn't like the look of it because the file changed and kills your process when you try and start the new binary. Clearly, this is a bug in macOS. We had to update our install scripts to copy the file a different way.
Hi, I'm pretty new to homebrew and the whole command line thing on the Mac, so please be kind ;) Every time I try to use YouTube-DL this happens:
youtube-dl --verbose "https://www.youtube.com/watch?v=lKeUCkBO8QA" zsh: killed youtube-dl --verbose "https://www.youtube.com/watch?v=lKeUCkBO8QA"
I spend hours googling for help, but I couldn't find anything. Can someone please explain to me what's going on there and wtf is killing that process?
Btw I got Vidl installed also.
I was able to solve this problem. I suspected that some login item made my /bin/bash turn weird. So under someone's recommendation I ran mac in safe mode, and found that everything ran perfectly. Thus, it was a specific login item which screwed up my bash.
For me, it was the yabai window management utility, as there must have been something in the startup script which screwed up my shell.
The first two things I check is uptime and ps -ef | wc to make sure you don’t have runaway processes and the default limits. If the system is not healthy enough to run that, restart and if it still immediately kills the shell, start again but in safe mode.
https://support.apple.com/guide/mac-help/start-up-your-mac-in-safe-mode-mh21245/mac
Hopefully these triage steps let you know the Mac is configured and runs well after a start and you can watch for something that’s added that exhausts your process count.
Once you’re sure it’s not process count and repeatably just brew that crashes or gets killed, restart normally, and look in the console for what specifically is crashing.
Pay particular attention to the status of Rosetta 2 and which brew tools are installed for which processor architecture on your Mac.
softwareupdate --install-rosetta
The output of brew doctor might be particularly helpful in this situation once obvious things are ruled out.
Try following these if these might help:
Since your installation works on the terminal you installed, all the exports you did, work on the current bash and its child process. but is not spawned to new terminals.
env variables are lost if the session is closed; using .bash_profile, you can make it available in all sessions, since when a bash session starts, it 'runs' its .bashrc and .bash_profile
Now follow these steps and see if it helps:
type
env | grep M2_HOMEon the terminal that is working. This should give something likeM2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
typing
env | grep JAVA_HOMEshould give like this:JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
Now you have the PATH for M2_HOME and JAVA_HOME.
If you just do ls /usr/local/apache-maven/apache-maven-3.1.1/bin, you will see mvn binary there.
All you have to do now is to point to this location everytime using PATH. since bash searches in all the directory path mentioned in PATH, it will find mvn.
now open
.bash_profile, if you dont have one just create onevi ~/.bash_profile
Add the following:
#set JAVA_HOME
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
export JAVA_HOME
M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2_HOME
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
export PATH
save the file and type
source ~/.bash_profile. This steps executes the commands in the.bash_profilefile and you are good to go now.open a new terminal and type
mvnthat should work.
Solutions above are good but they require ~/.bash_profile. /usr/local/bin is already in the $PATH and it can be confirmed by doing echo $PATH. Download maven and run the following commands -
$ cd ~/Downloads
$ tar xvf apache-maven-3.5.3-bin.tar.gz
$ mv apache-maven-3.5.3 /usr/local/
$ cd /usr/local/bin
$ sudo ln -s ../apache-maven-3.5.3/bin/mvn mvn
$ mvn -version
$ which mvn
Note: The version of apache maven would be the one you will download.