The reason is that flink-scala-shell uses scala-2.11 which uses jvm-1.6 as
its target by default, that's why it can not use any library that depends
on jvm-1.8.

You can use Zeppelin instead which supports scala-shell of scala-2.12, I
have verified that it works in Zeppelin when you use scala-2.12.

Check these links for more details.

https://zeppelin.apache.org/docs/0.10.0/interpreter/flink.html
https://medium.com/analytics-vidhya/learn-flink-sql-the-easy-way-d9d48a95ae57



Jing Lu <ajin...@gmail.com> 于2021年10月30日周六 上午2:03写道:

> Hi Flink users,
>
> I am working on testing my code in start-scala-shell.sh. The flink version
> is: flink-1.12.0-bin-scala_2.11.tgz. I put the jar file (
> https://mvnrepository.com/artifact/software.amazon.awssdk/sts/2.15.65) in
> the lib folder.
>
> Then run the start-scala-shell.sh REPL:
>
> scala> import software.amazon.awssdk.services.sts.StsAsyncClient
> import software.amazon.awssdk.services.sts.StsAsyncClient
>
> scala> StsAsyncClient.builder
> <console>:72: error: Static methods in interface require -target:jvm-1.8
>        StsAsyncClient.builder
>
> Why do I have this error? Is there any way to solve this problem?
>
>
> Thanks,
> Jing
>
>

-- 
Best Regards

Jeff Zhang

Reply via email to