Question: I installed Java 17 version with [asdf](https://asdf-vm.com) and it works without any problems in a Java project:

```
➜  ~ asdf list java
  adoptopenjdk-17.0.0+35

```

But when checking the java version with `java -version` in the terminal, it displays the following errors:

```
~ java -version
/Users/xxx/.asdf/shims/java: line 3: /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf: No such file or directory
/Users/xxx/.asdf/shims/java: line 3: exec: /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf: cannot execute: No such file or directory

```

I'm using Oh My Zsh terminal and the following line:

```
. /opt/homebrew/opt/asdf/libexec/asdf.sh

```

added after installation o `asdf` is the last one in the `.zshrc` file.

What's wrong with that? Thank you.

Answer: 
This solved the issue for me:

1. rename the `~/.asdf/shims` directory
2. run `asdf reshim`

[More details](https://github.com/asdf-vm/asdf/issues/1147#issuecomment-1006067709).
Try

```sh
asdf global java adoptopenjdk-17.0.0+35

asdf reshim

```

It sets `adoptopenjdk-17.0.0+35` as default for the user and then asdf will update the shims.