我想部署我的java 7应用程序Heroku但是我遇到了java版本的一些问题.
我system.properties在我的项目根目录(在哪里src和哪里pom.xml)添加了文件内容,java.runtime.version=1.7但我仍然得到这样的东西:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project lets-code: Fatal error compiling: invalid target release: 1.7
Run Code Online (Sandbox Code Playgroud)
所以我对下一步做什么感到困惑.
我使用了以下指南https://devcenter.heroku.com/articles/customizing-the-jdk:
\n\n\n\n\n指定 JDK 版本\n 创建一个 system.properties 文件(如果尚不存在),指定版本,然后将其提交到 git。Java 支持文章中描述了支持的版本。文件\xe2\x80\x99s 内容应如下所示:
\n\njava.runtime.version=11\n 然后通过运行以下命令将文件添加到 Git:
\n\ngit add system.properties\n git commit -m "JDK 11"
\n
这个对我有用。
\n