2014-03-25 92 views
2

我在playframework 2.2。中構建一個應用程序,當我運行應用程序在本地運行它運行良好,但是當我嘗試上傳到heroku與git push heroku master它開始上傳很好,但過了一段時間它總是以這些錯誤結束:推送我的存儲庫(JAVA應用程序)到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 [email protected]:glacial-plateau-2895.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:glacial-plateau-2895.git' 

有人可以幫助我嗎? 我已經搜索,但我沒有找到可以幫助我的類似問題。

在此先感謝。

+0

看起來像你的heroku環境運行Java 6 – fge

回答

2
[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...

+0

感謝您的答覆。 – Nunovsky