Jet
Jet

Reputation: 3308

Error:scala: 'jvm-1.8' is not a valid choice for '-target' in sbt project

I have a scala,sbt project to run and getting the exception below. Tried to find the solution on internet, only gradle related solutions were available.

Error:scala: 'jvm-1.8' is not a valid choice for '-target'

Error:scala: bad option: '-target:jvm-1.8'

I tried changing the compiler config and other intellij idea settings but unsuccessful to get rid of this issue. What is missing here ?

Attached the screenshot. enter image description here

Upvotes: 2

Views: 2810

Answers (2)

Jackie
Jackie

Reputation: 25997

encountered same issue with gradle. turns out need to update gradle to latest version. you might would like to try same for SBT.

Upvotes: 0

marios
marios

Reputation: 8996

This is the setting you are missing in SBT (added in build.sbt):

javacOptions ++= Seq("-target", "1.8")

Upvotes: 1

Related Questions