[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-java) @ org.openhab.addons.reactor.bundles **---**
[WARNING**] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 18.0.1 is not in the allowed range [11.0,18.0).
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE**
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.076 s
[INFO] Finished at: 2022-07-17T19:22:32+02:00
[INFO]------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce **(enforce-java)** on project org.openhab.addons.reactor.bundles: **Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.** -> **[Help 1]**
If you are under linux there might be a $JAVA_HOME coming into play. Depending on the distribution update-alternatives might not update it leading to situation where tools which rely on environment variable get crazy.
I am not using jenv. I know for sure maven doesn’t use it as well, so you have to find a way to link it over JAVA_HOME. I use for that purpose direnv which is more generic.
$ java -version
openjdk version "18" 2022-03-22
OpenJDK Runtime Environment (build 18+36-2087)
OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)
Detected JDK version 18 (JAVA_HOME=C:\Program Files\tools\jdk-18) is not in the allowed range [17.0,18.0)
I also tried to use 18.0.2 but it showed:
$ java -version
openjdk version "18.0.2" 2022-07-19
OpenJDK Runtime Environment (build 18.0.2+9-61)
OpenJDK 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing)
Detected JDK version 18.0.2 (JAVA_HOME=C:\Program Files\tools\jdk-18.0.2) is not in the allowed range [17.0,18.0).
my guess is that “18.0.2” is not “18.0” and “18” is also not “18.0”.
But how can i install exactly “18.0” since the version string does not state this?