Hi,

On 19.07.22 19:17, Hilco Wijbenga wrote:
On Tue, Jul 19, 2022 at 10:15 AM Karl Heinz Marbaise <khmarba...@gmx.de> wrote:
On 19.07.22 19:10, Tamás Cservenák wrote:
Actually, yes, I keep forgetting about release flag: so, if running on
LTS, user can do:
- use compiler "release" flag to target any Java from 8 to 17 (up to
current LTS it runs on)

You can build for target JDK 7 with JDK17 via --release ...
and also not ONLY on LTS release of JDK you can use also non LTS
versions for that...

This only affects the generated bytecode, though? If you use anything
only available in a later JDK then your app/library will fail at
runtime, i.e. once it hits something that is actually _running_ the
older JDK.

Perhaps things have improved in this area but when we tried this
(years ago), it was a pain.

Using the --release option will check things like using the correct
API's also the byte code will be correct for the appropriate target..

That has been changed since JDK9...

Yes before that was a pain (using animal sniffer to check things like
that etc.)

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to