0

I'm trying to learn Ninja framework for building RESTful web services at here

I got the following error when I run "mvn clean install" inside the newly created maven project folder:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.610 s
[INFO] Finished at: 2014-05-19T11:39:50-07:00
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ninja: Fatal error compiling: invalid target release: 1.7 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I am on Mac Mavericks with Java 8, if this matters. Thanks

4

1 回答 1

3

好吧,这听起来可能很傻,但是我通过将 JAVA_HOME 添加到我的 Mac 上的路径来解决了这个问题,否则,maven 仍然在我的计算机上使用 Java 1.6(我已经安装了 Java 1.8)。

export JAVA_HOME=$(/usr/libexec/java_home)
于 2014-05-19T21:27:56.513 回答