【发布时间】:2014-09-24 20:26:25
【问题描述】:
我正在尝试针对示例项目运行 maven 目标,同时启动一个新项目。我是 Mac 和 IntelliJ 的新手(我在评估它时正在与 Eclipse Luna 一起运行社区版)。这一切都在 Eclipse 和终端中工作。
我遇到的问题是让 Maven 在 Java 8 中运行它。我已将 JAVA_HOME 配置为 1.8,将项目 JDK 设置为 1.8,将语言级别设置为 1.8,等等。代码编译(使用 lambdas)所以 1.8显然是 IntelliJ 正在使用的。但是 Maven 插件似乎不想尊重该设置。
这是 maven 目标配置(使用 Deploy 目标): 工作目录:/Users/brian.trezise/IdeaProjects/exampleservice 命令行:全新安装 tomcat7:run
当我从 Maven Projects 弹出窗口执行目标时,它会执行以下操作:
/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
在 Maven 尝试编译(下载所有依赖项等)之前,它似乎运行良好,然后我收到以下错误:
[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)
我不确定如何将其配置为使用“-source 8”(如果我将其添加到命令行,它就会失败)。
有人愿意同情 IntelliJ 新手吗?
【问题讨论】:
标签: java macos maven intellij-idea