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 runs fine when I run it through main method but throws the following error when I try to compile it:
\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 Eclipse IDE and trying to compile it through command line.