3 ms·
The Maven ecosystem partly solves the "the right java" problem, although it's not necessarily well known and not particularly great. 1. For selecting the corre
by oftenwrong 4y ago
The Maven ecosystem partly solves the "the right java" problem, although it's not necessarily well known and not particularly great.
1. For selecting the correct JDK to use with standard plugins, including the compiler plugin, there's support for toolchains:
https://maven.apache.org/guides/mini/guide-using-toolchains.html https://maven.apache.org/guides/mini/guide-using-toolchains....
2. For ensuring Maven itself is run with the correct JDK, it is a commom recommendation to use the Enforcer plugin to specify the required JDK version and/or vendor, as well as the Maven version:
https://maven.apache.org/enforcer/enforcer-rules/index.html https://maven.apache.org/enforcer/enforcer-rules/index.html
3. It is increasingly common to use Maven Wrapper to supply Maven, which you seem to be aware of.
4. Maven will run with the JDK pointed to by JAVA_HOME, of course.