'intellij:project level jdk not taken up by sbt

I have configured jdk 17 for my scala project in intellij, but when I run 'sbt clean compile' I still see it targeting Java 8 which is one pointed by my JAVA_HOME:

>sbt clean compile
[info] welcome to sbt 1.5.8 (Azul Systems, Inc. Java 1.8.0_282)

I expect it to target Java 17.

How can I get it working?



Solution 1:[1]

intellij-->file-->project structure-->project setting-->project-->select you java version

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 katyRosale