I'm on MacOS, zsh.
I've installed jenv, added several java versions.
I've ran
jenv enable-plugin maven
and
jenv enable-plugin export
jenv doctor returns:
[OK] JAVA_HOME variable probably set by jenv PROMPT
[OK] Java binaries in path are jenv shims
[OK] Jenv is correctly loaded
jenv versions returns:
* system (set by /Users/[user]/.jenv/version)
1.8.
1.8.0.271
11
11.0
...
But when I start a terminal session and run mvn --version I get
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
If I set a non system java version with jenv it works fine, like:
~/ jenv shell 11
~/ mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.9, ...
But how come it doesn't work when the jenv version is system?