Maven targets Java 1.5 by default, so this example that uses features of Java 1.8 is not going to compile. Did you have some settings in your ~/.m2/settings.xml
file that were not captured in this repo?
$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sparksocket 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sparksocket ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sparksocket ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/cswarth/Development/spark-websocket/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/cswarth/Development/spark-websocket/src/main/java/Chat.java:[10,63] diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
[ERROR] /Users/cswarth/Development/spark-websocket/src/main/java/Chat.java:[21,59] method references are not supported in -source 1.5
(use -source 8 or higher to enable method references)
[ERROR] /Users/cswarth/Development/spark-websocket/src/main/java/Chat.java:[21,83] lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
[INFO] 3 errors