Most people and use cases have the Java Home is the same version you put in source/target/release.
The part I was trying to highlight was, if you set release and have Java Home and Path to Java 1.7 (as the title of the email indicates), then it won't work, so you need to use source and target. If it was a type and the person has Java Home and Path set to Java 17, then use release. Also what I posted is the text from the maven compiler plugin. On Sat, 26 Mar 2022 at 15:05, Alexander Kriegisch <alexan...@kriegisch.name> wrote: > John Patrick schrieb am 26.03.2022 16:12 (GMT +07:00): > > > I thought maven.compiler.release only supports Java 9 and newer (The > > -release argument for the Java compiler, supported since Java9). > > Small correction: The javac compiler option '--release N' exists since > JDK 9, but you can also compile to older versions. A little overview, > quickly compiled from what I happen to have installed locally (no 12): > > > javac | --release > ------|---------- > 9 | 6-9 > 10 | 6-10 > 11 | 6-11 > 13 | 7-13 > 14 | 7-14 > 15 | 7-15 > 16 | 7-16 > 17 | 7-17 > 18 | 7-18 > > > BTW, most people around here probably know, but for those who do not: > '--release N' is **not** the same as '-source N -target N', but also > ensures that code is cross-compiled not just to the byte code level N > like with '-target N', but also to the exact JDK API of that version - > basically a more user-friendly way to set an older JDK as boot classpath > for compilation, without the need to install extra JDKs or toolchains. > Each JDK 9+ contains a compressed set of legacy API descriptions > utilised by '--release N'. > > I.e., while the compiler option really just exists since JDK 9, you can > still target certain older bytecode and/or JDK API versions. And if you > need really old bytecode targets in a brandnew and well-maintained > compiler, you can use ECJ. Current version 3.29.0 still supports source > and target versions as old as 1.3 (and of course up to 18) - a unique > selling point in comparison to Javac. > > -- > Alexander Kriegisch > https://scrum-master.de > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >