0

When I try to run mvn validate, I get the following error.

/Users/syncmaster/.asdf/shims/mvn: line 3: /usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: No such file or directory
/Users/syncmaster/.asdf/shims/mvn: line 3: exec: /usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: cannot execute: No such file or directory

However here is the details of my asdf

ASDF Version

$asdf --version
v0.10.1

$whereis asdf
asdf: /usr/local/opt/asdf/libexec/bin/asdf

$ls /usr/local/Cellar/asdf
0.10.1

From brew:

brew info asdf
asdf: stable 0.10.1 (bottled), HEAD
Extendable version manager with support for Ruby, Node.js, Erlang & more
https://asdf-vm.com/
/usr/local/Cellar/asdf/0.10.1 (168 files, 714.3KB) *
  Poured from bottle on 2022-05-19 at 10:42:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/asdf.rb

My .zshrc has the following line.

. /usr/local/opt/asdf/libexec/asdf.sh

How can I fix my ASDF version so that maven uses the correct one?

SyncMaster
  • 9,754
  • 34
  • 94
  • 137
  • Can you explain why you are using asdf ? I don't understand the need for that? – khmarbaise May 24 '22 at 18:06
  • I use `asdf` to manage my software versions. I use asdf for managing Java, Python, Maven versions. – SyncMaster May 24 '22 at 18:19
  • How many versions of Maven do you use? Apart from that you could install Maven once and use... and maybe when next release comes out you can upgrade to a newer version? Furthermore Maven does not use any kind of this things? – khmarbaise May 24 '22 at 18:56

1 Answers1

1

I fixed this by reinstalling maven using asdf.

Here is why I need ASDF for my Maven installation - I need Maven 3.6.3 and homebrew only supports 3.5 and 3.8. Instead of installing Maven manually, I prefer using ASDF to take care of the installation.

Uninstalled Maven first

asdf uninstall maven 3.6.3
asdf plugin remove maven

Reinstalled Maven

asdf list all maven 3.6
asdf install maven 3.6.3
asdf global maven 3.6.3
SyncMaster
  • 9,754
  • 34
  • 94
  • 137