I work with the above hands on practice. When I try with Java 11. I get the below error:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
But, it worked fine when I changed the java version in the pom.xml to 1.8. I have Java 11.0.4 installed in my macbook and I have set the same JDK in my Intellij.