Twitter 机器人、Java、Heroku。“状态从 up 变为 crashed”

我有一个用 twitter4j 构建的简单 Java Twitter 机器人。我只需要一个不间断运行的 Java 类,它应该一切正常。它在本地运行良好,但由于某种原因无法在 Heroku 上运行。


以下是它在尝试运行时所说的内容:


2019-05-07T18:54:50.555626+00:00 heroku[worker.1]: Starting process with command `java -cp src/BotLottery.java`


2019-05-07T18:54:51.243272+00:00 heroku[worker.1]: State changed from starting to up


2019-05-07T18:54:52.269893+00:00 heroku[worker.1]: Process exited with status 1


2019-05-07T18:54:52.294324+00:00 heroku[worker.1]: State changed from up to crashed


2019-05-07T18:54:52.116218+00:00 app[worker.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 


2019-05-07T18:54:52.217204+00:00 app[worker.1]: Usage: java [-options] class [args...]


2019-05-07T18:54:52.217208+00:00 app[worker.1]:            (to execute a class)


2019-05-07T18:54:52.217210+00:00 app[worker.1]:    or  java [-options] -jar jarfile [args...]


2019-05-07T18:54:52.217212+00:00 app[worker.1]:            (to execute a jar file)


2019-05-07T18:54:52.217213+00:00 app[worker.1]: where options include:


2019-05-07T18:54:52.217215+00:00 app[worker.1]:     -d32      use a 32-bit data model if available


2019-05-07T18:54:52.217216+00:00 app[worker.1]:     -d64      use a 64-bit 

data model if available


2019-05-07T18:54:52.217218+00:00 app[worker.1]:     -server   to select the "server" VM


2019-05-07T18:54:52.217220+00:00 app[worker.1]:                   The default VM is server,


2019-05-07T18:54:52.217224+00:00 app[worker.1]:                   because you are running on a server-class machine.


2019-05-07T18:54:52.217226+00:00 app[worker.1]: 


2019-05-07T18:54:52.217227+00:00 app[worker.1]: 


胡说叔叔
浏览 76回答 1
1回答

斯蒂芬大帝

使用命令启动进程java -cp src/BotLottery.java这对我来说不合适。类路径为空。它应该是一个.jar或一个.class文件。不是.java文件。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java