I'm attempting to run a maven target against an example project while ramping up on a new project. I'm new to both Mac and IntelliJ (I'm running community edition side-by-side with Eclipse Luna while I evaluate it). This all works in Eclipse and from the terminal.
The problem I'm having is getting Maven to run it in Java 8. I've configured JAVA_HOME to 1.8, set the project JDK to 1.8, language level to 1.8, etc. The code compiles (with lambdas) so 1.8 is clearly what IntelliJ is using. But the Maven plugin doesn't seem to want to honor that setting.
Here's the maven target configuration (using the Deploy target): Working Directory: /Users/brian.trezise/IdeaProjects/exampleservice Command Line: clean install tomcat7:run
When I execute the target from the Maven Projects popout, this is what it executes:
/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java -Dmaven.home=/usr/local/Cellar/maven/3.2.2/libexec -Dclassworlds.conf=/usr/local/Cellar/maven/3.2.2/libexec/bin/m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13 CE.app/bin" -Dfile.encoding=UTF-8 -classpath "/usr/local/Cellar/maven/3.2.2/libexec/boot/plexus-classworlds-2.5.1.jar:/Applications/IntelliJ IDEA 13 CE.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=13.1.4 clean install tomcat7:run
It seems to run fine up until Maven tries to compile (downloads all the dependencies, etc) then I get the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project inin-example-app: Compilation failure
[ERROR] /Users/brian.trezise/IdeaProjects/exampleservice/src/main/java/com/inin/example/controller/PingController.java:[53,49] lambda expressions are not supported in -source 1.7
[ERROR] (use -source 8 or higher to enable lambda expressions)
I'm not sure how to configure it to use "-source 8" (if I add that to the command line it just fails).
Anybody willing to take pity on a IntelliJ newb?