Christofer Dutz created THRIFT-5729:
---------------------------------------

             Summary: Configure the compiler-plugin to produce Java 8 
compatible code
                 Key: THRIFT-5729
                 URL: https://issues.apache.org/jira/browse/THRIFT-5729
             Project: Thrift
          Issue Type: Task
          Components: Java - Library
    Affects Versions: 0.18.1
            Reporter: Christofer Dutz


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:
{code:java}
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> {code}
Starting with Java 9, the following would need to be set:
{code:java}
<maven.compiler.release>8</maven.compiler.release> {code}
A little self-activating maven profile could help with that:
{code:java}
<profile>
    <id>.java-9-and-above</id>
    <activation>
        <jdk>[9,)</jdk>
    </activation>
    <properties>
        <maven.compiler.release>8</maven.compiler.release>
    </properties>
</profile>{code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to