有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

git将我的存储库(JAVA应用程序)推送到heroku失败

我正在playframework 2.2中构建应用程序。,当我使用play run在本地运行应用程序时,它运行正常,但当我尝试使用git push heroku master上传到heroku时,它开始上传正常,但一段时间后,它总是以以下错误结束:

       [info] downloading http://s3pository.heroku.com/maven-central/org/par
ed/parboiled-core/1.1.5/parboiled-core-1.1.5.jar ...
       [info]   [SUCCESSFUL ] org.parboiled#parboiled-core;1.1.5!parboiled-c
jar(bundle) (245ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/ow2
/asm/4.1/asm-4.1.jar ...
       [info]   [SUCCESSFUL ] org.ow2.asm#asm;4.1!asm.jar (198ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/ow2
/asm-tree/4.1/asm-tree-4.1.jar ...
       [info]   [SUCCESSFUL ] org.ow2.asm#asm-tree;4.1!asm-tree.jar (109ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/ow2
/asm-analysis/4.1/asm-analysis-4.1.jar ...
       [info]   [SUCCESSFUL ] org.ow2.asm#asm-analysis;4.1!asm-analysis.jar
ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/ow2
/asm-util/4.1/asm-util-4.1.jar ...
       [info]   [SUCCESSFUL ] org.ow2.asm#asm-util;4.1!asm-util.jar (354ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/sca
ang/scala-compiler/2.10.3/scala-compiler-2.10.3.jar ...
       [info]   [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.3!scala-com
r.jar (8070ms)
       [info] downloading http://s3pository.heroku.com/maven-central/org/sca
ang/jline/2.10.3/jline-2.10.3.jar ...
       [info]   [SUCCESSFUL ] org.scala-lang#jline;2.10.3!jline.jar (307ms)
       [info] Done updating.
       [info] Compiling 5 Scala sources and 11 Java sources to /tmp/scala_bu
ack_build_dir/target/scala-2.10/classes...
       [info] 'compiler-interface' not yet compiled for Scala 2.10.3. Compil
..
       [info]   Compilation completed in 23.023 s
       [error] /tmp/scala_buildpack_build_dir/app/utils/DatabaseConnection.j
45: illegal start of type
       [error]         List<String> results = new ArrayList<>();
       [error]                                              ^
       [error] 1 error
       [error] (compile:compile) javac returned nonzero exit code
       [error] Total time: 387 s, completed Mar 25, 2014 4:20:51 PM
 !     Failed to build app with sbt

 !     Push rejected, failed to compile Play 2.x - Java app

To git@heroku.com:glacial-plateau-2895.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:glacial-plateau-2895.git'

有人能帮我吗? 我已经搜索过了,但没有找到类似的问题可以帮助我

提前谢谢


共 (2) 个答案

  1. # 1 楼答案

       [error] /tmp/scala_buildpack_build_dir/app/utils/DatabaseConnection.java:45:
                   illegal start of type
       [error]         List<String> results = new ArrayList<>();
       [error]                                             ^
    

    这意味着Heroku环境中的JDK是Java 6,而代码是Java 7。升级;)

    Here's info how to...