Why do you need Java 11 bytecode though?
Java 8 bytecode runs fine on Java 11. The settings in the build are really
there for testing, not because it's required to use Java 11.

On Mon, Jul 18, 2022 at 10:29 PM Gera Shegalov <g...@apache.org> wrote:

> Bytecode version is controlled by javac "-target" option for Java, and by
> scalac "-target:" for Scala
> JDK can cross-compile between known versions.
>
> Spark uses 1.8 as source and target by default controlled by the Maven
> property java.version
> <https://github.com/apache/spark/blob/00d7094dc3024ae594605b311dcc55e95d277d5f/pom.xml#L109>.
> But it's also hard-coded with -target:jvm-1.8
> <https://github.com/apache/spark/blob/00d7094dc3024ae594605b311dcc55e95d277d5f/pom.xml#L2891>
> for Scala. Higher JDK versions can run lower version bytecode.
>
> if you want to try 11, replace occurences -target:jvm-1.8 by
> --target:jvm-${java.version} in pom.xml you should be able to produce 11
> bytecode by adding -Djava.version=11 to your Maven build command.
>
> ./build/mvn -Djava.version=11  ...
>
> However, I did not try beyond a quick compile on core and cannot say
> anything about fallout implications at run time.
>

Reply via email to