'jvm-1.8' is not a valid choice for '-target'

前端 未结 7 991
一整个雨季
一整个雨季 2021-01-01 17:07

IntelliJ complains with the following exception when I try to make my project.

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


        
7条回答
  •  鱼传尺愫
    2021-01-01 17:21

    In Intellij IDEA (15 CE) add this scalac compiler option:

    Build, Execution, Deployment -> Compiler -> Scala Compiler -> Default

    Additional compiler options: -target:jvm-1.7 (was empty).

    There were also profiles Gradle 1, ... with -target:jvm-1.8, so I changed them also to -target:jvm-1.7.

    I'm using Scala 2.10, JVM 1.8, source compatibility 1.7. It helped in my case.

提交回复
热议问题