I installed it from here https://aur.archlinux.org/jdk.git and i did find out that i have to set it to the newest version with sudo archlinux-java set java-20-openjdk
I would, how can i? I think there was an older version installed and the only guide i found installed a .git version. I also don’t know which i set now. Isn’t it the jdk-openjdk?
java -version  ✔
openjdk version "20.0.2" 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9)
OpenJDK 64-Bit Server VM (build 20.0.2+9, mixed mode, sharing)
Don’t just follow any guides you find on the internet, and especially not when it pertains to other distributions than Manjaro. It’s a bad strategy and it’s bound to get you into trouble.
The jre-openjdk and jdk-openjdk packages from the Manjaro repo are fully up to date, and their version is the same as that of the git version you got off the AUR.
You are better off removing the AUR package and sticking with the openjdk versions.
Note: Just because something has a higher version number doesn’t mean that it’s better. That’s Windows-think.
You should have both version 11 and version 20 installed. 11 is only there as a dependency for another package. 20 is the one that will normally be used for everything else.
It will probably just be called jdk — the short name. Either way, you can look it up in octopi or the pamac GUI. They can show you what you have installed and where from.
If it has an icon next to it, then it’s from the AUR or elsewhere, but not from the repositories.