You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nick Dimiduk (Jira)" <ji...@apache.org> on 2021/12/23 00:34:00 UTC

[jira] [Updated] (HBASE-25465) Use javac --release option for supporting cross version compilation in create-release

     [ https://issues.apache.org/jira/browse/HBASE-25465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Dimiduk updated HBASE-25465:
---------------------------------
    Assignee: Nick Dimiduk
      Status: Patch Available  (was: Open)

Putting up a patch for release managers to try out. If you want to use this for our other projects (i.e., hbase-thirdparty), you'll need to replicate the pom changes into those builds.

> Use javac --release option for supporting cross version compilation in create-release
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-25465
>                 URL: https://issues.apache.org/jira/browse/HBASE-25465
>             Project: HBase
>          Issue Type: Improvement
>          Components: create-release
>            Reporter: Andrew Kyle Purtell
>            Assignee: Nick Dimiduk
>            Priority: Minor
>
> See https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
> {quote}
>  the Java compiler’s --release parameter, which was introduced via JEP 247 ("Compile for Older Platform Versions"), added to the platform also in JDK 9. In contrast to the more widely known pair of --source and --target, the --release switch will ensure that only byte code is produced which actually will be usable with the specified Java version. For this purpose, the JDK contains the signature data for all supported Java versions (stored in the $JAVA_HOME/lib/ct.sym file).
> {quote}
> Using one JDK (i.e. Java 11) to build Java 8-and-up and Java 11-and-up compatible release artifacts would reduce some sources of accidental complexity, assuming the --release parameter actually works as advertised. To produce Java 8-and-up compatible artifacts, supply --release=8. To produce Java 11-and-up compatible release artifacts, supply --release=11. Maven activations based on JDK version and command line defined profiles can control what --release parameter, if any, should be passed to the compiler. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)