使用 maven (heroku) 编译 java7 项目时出错 [英] error compiling java7 project with maven (heroku)
问题描述
我正在尝试使用 maven 在 heroku 简单 servlet 上上传.在本地我的 servlet 工作得很好,但是当我使用时:
I'm trying to upload on heroku simple servlet with maven. Locally my servlet is working just fine but when i use:
git push heroku master
我收到带有错误消息的BUILD FAILURE":
I get "BUILD FAILURE" with error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:
3.1:compile (default-compile) on project HelloServlet: Fatal error compiling:
invalid target release: 1.7 -> [Help 1]
我在系统变量中将所有内容更改为 Java 1.7,maven 运行的是 Java 1.7,javac 版本是 1.7?
I changed everything to Java 1.7 in system variables, maven is running Java 1.7, javac version is 1.7?
我在这里遗漏了什么吗?
Am I missing something here?
我的 JAVA_HOME 和错误截图
edit: my JAVA_HOME and error screenshot
推荐答案
默认情况下,heroku 应用程序在 OpenJDK 6 上运行.您必须添加其他属性才能使您的应用程序在 heroku 上使用 Open JDK 7.
By default heroku apps run on OpenJDK 6.You have to add additional properties to make your app use Open JDK 7 on heroku.
参考:https://devcenter.heroku.com/articles/add-java-version-to-an-existing-maven-app
这篇关于使用 maven (heroku) 编译 java7 项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!