I have the following code:
package com.mongoDB; import spark.Spark; public class HelloWorldSparkStyle { public static void main(String[] args) { Spark.get("/hello", (req, res) -> "Hello World"); } }
It works fine when I run it using the main method, but when I try to compile it, it produces the following error:
\HelloWorldSparkStyle.java:[9,33] error: lambda expressions are not supported in -source 1.5 D:\WorkspaceWithJava8\BeginnerProject>javac -version javac 1.8.0_60
I am using the Eclipse IDE and trying to compile it through the command line.
source share