Hey, Apologies for the late response.
> The <maven.compiler.release> and <maven.compiler.testRelease> > properties do not specify which JDK to use. By default, Maven always > uses the compiler provided with the Java release on which Maven is > running, and the above properties only specify the values to give to > the --release option. Right. To be honest I completely overlooked this, and the basic question of "if it was selecting the JDK, how would it know where to find them". It should have been obvious its just changing the --release flag within whatever JDK is within $PATH. > For checking on which Java release Maven is running, > execute `mvn --version` on the command line. If a different JDK is > desired for the compilation and the tests, toolchain can be used. Toolchain needs a config which as far as I am aware needs to be added to the users .m2 directory within their home directory. This will break distro build systems. Also even if it could be possible it adds extra steps, and an extra file to maintain. > But it may be easier to just set the JAVA_HOME environment variable > to the path to the desired JDK before to run Maven. This isn't ideal, I was hoping for a better way but I guess this really is the most ideal way (which I am already doing). Apologies for my stupid question, I was hoping for a better solution but I guess I was already doing it as good as it will get. A little side question then, is there any benefit of setting the target Java version within the maven compiler plugin or is it just best to always use JAVA_HOME to decide (as the JDK version will the default version)? Thanks, -- Polarian Jabber/XMPP: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
