I have followed instructions in probably a dozen Stack Overflow posts so far, but I keep ending up with the same error. Any help would be really appreciated.
I am upgrading from Java 11 to Java 17. I am using a Macbook Pro, Sonoma 14.4.1. In an attempt to simplify things, I started out by uninstalling every single jdk that I had installed on my Mac.
I then installed the Java jdk for Java 17. Java seems to be working properly, but when I try to run any maven command I get this error.
$ mvn -version
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
I followed the instructions in this post exactly mvn command not found in OSX Mavericks (and a few others similar to it). But seems like no matter what I do, I keep coming back to this error. Any help would be really appreciated.