You installed a newer JDK, opened a fresh Terminal window, ran java -version , and still saw JDK 8, JDK 11, or a vendor you did not expect. The install probably worked. The more common problem is that the java command is resolving a different JDK from the one you think you selected.
Source: [Dev.to](https://dev.to/noah_1/java-version-shows-the-wrong-version-on-mac-24ii)