Why won't eclipse switch the compiler to Java 8?

前端 未结 11 1600
无人及你
无人及你 2020-12-09 08:06

I checked out a Java project from SVN in eclipse and realized that it requires Java 8 because it uses lambdas etc. I installed the eclipse addon for Java 8 and restarted ecl

11条回答
  •  天命终不由人
    2020-12-09 08:40

    Old question, but posting the answer incase it helps someone. Already build path was configured to use JDK 1.2.81 However, build was failing with the error below:

     lambda expressions are not supported in -source 1.5
    [ERROR]   (use -source 8 or higher to enable lambda expressions)
    

    In the latest Eclipse (Photon), adding the below entry to pom.xml worked.

      
        UTF-8
        1.8
        1.8
      
    

提交回复
热议问题