首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将我的存储库(JAVA应用程序)推到heroku失败

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

Stack Overflow用户
提问于 2014-03-25 16:59:38
回答 2查看 2.7K关注 0票数 2

我正在构建一个在游戏框架2.2中的应用程序。当我在本地运行这个应用时,play run运行的很好,但是当我尝试用git上传到heroku时,推着heroku的主,它开始上传的很好,但是过了一段时间,它总是以以下错误结束:

代码语言:javascript
复制
       [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'

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

提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2014-03-25 17:12:35

代码语言:javascript
复制
   [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.升级;)

以下是如何..。

票数 2
EN

Stack Overflow用户

发布于 2014-03-30 03:51:05

如果要在Heroku上使用java 7,则需要在项目的根文件夹中添加一个带有指令的文件。详细信息- https://devcenter.heroku.com/articles/add-java-version-to-an-existing-maven-app

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22641457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档