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

前端 未结 7 996
一整个雨季
一整个雨季 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:28

    I got the same error message using IntelliJ 2017.2.5 w/ JRE 1.8.0, scala 2.10.5 and gradle 3.3. I solved my problem by checking the "Delegate IDE build/run actions to gradle" checkbox in IntelliJ's IDE located at

    Settings>Build,Execution,Deployment>Build Tools>Gradle>Runner

    Details can be found here: https://docs.gradle.org/4.2.1/userguide/scala_plugin.html#ideaTargetVersion and https://www.jetbrains.com/help/idea/gradle.html

    Of note, I was able to build my gradle project outside of IntelliJ (i.e. cmd line) and only received this error on attempting to build using the IntelliJ IDE.

提交回复
热议问题