Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5729

Configure the compiler-plugin to produce Java 8 compatible code

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.18.1
    • None
    • Java - Library
    • None

    Description

      Right up till Thrift 0.17.0 the class format was 52 (Java 1.8) but with 0.18.0 this changed to 55 (Java 11).

      From a quick look, the code seems to imply the baseline for building should be Java 8, however it can only be consumed by applications running at least Java 11.

      By configuring the maven-compiler plugin accordingly, the library should be consumable by Java 8 applications as well.

      I know Thrift uses Gradle to compile the library and I'm not very proficient with that. However here's how we configure this in other Apache projects with Maven. I am sure there are matching options in Gradle:

      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target> 

      Starting with Java 9, the following would need to be set:

      <maven.compiler.release>8</maven.compiler.release> 

      A little self-activating maven profile could help with that:

      <profile>
          <id>.java-9-and-above</id>
          <activation>
              <jdk>[9,)</jdk>
          </activation>
          <properties>
              <maven.compiler.release>8</maven.compiler.release>
          </properties>
      </profile>

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cdutz Christofer Dutz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: