我有一个play Framework2.1.1java应用程序,它在本地主机上运行良好。
我想把它部署到Heroku,所以我遵循了这些指示
一切顺利,直到我进入这一行:
$ git push heroku master当我在CMD中输入这一行时,在结束时会得到以下错误:
remote: [info] Compiling 1 Scala source to /tmp/scala_buildpack_build_dir
/.sbt_home/plugins/target/scala-2.9.2/sbt-0.12/classes...
remote: [error] error while loading CharSequence, class file '/tmp/scala_
buildpack_build_dir/.jdk/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
remote: [error] (bad constant pool tag 18 at byte 10)
remote: [error] error while loading Comparator, class file '/tmp/scala_bu
ildpack_build_dir/.jdk/jre/lib/rt.jar(java/util/Comparator.class)' is broken
remote: [error] (bad constant pool tag 18 at byte 20)
remote: [error] two errors found
remote: [error] (compile:compile) Compilation failed
remote: Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
remote: ! ERROR: Failed to run sbt!
remote: We're sorry this build is failing! If you can't find the issue in
application
remote: code, please submit a ticket so we can help: https://help.heroku.
com
remote: You can also try reverting to the previous version of the buildpa
ck by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku- buildpac
k-scala#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote:
remote: ! Push rejected, failed to compile Play 2.x - Java app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to project.
remote:
To https://git.heroku.com/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project.git'我真的不知道该怎么办,谁能帮我?
谢谢
发布于 2015-07-21 21:25:51
看起来,您试图部署一个使用Scala2.9的应用程序,该应用程序不支持Java 8,但在Heroku上,Java 8是默认的。
尝试将一个system.properties文件添加到应用程序的根目录中,并将以下代码放入其中:
java.runtime.version=1.7然后将该文件添加到Git中,然后按如下方式重新部署:
$ git add system.properties
$ git commit -m "Set JDK version to 7"
$ git push heroku masterhttps://stackoverflow.com/questions/31549605
复制相似问题