我有一個用 twitter4j 構(gòu)建的簡單 Java Twitter 機器人。我只需要一個不間斷運行的 Java 類,它應(yīng)該一切正常。它在本地運行良好,但由于某種原因無法在 Heroku 上運行。以下是它在嘗試運行時所說的內(nèi)容: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 up2019-05-07T18:54:52.269893+00:00 heroku[worker.1]: Process exited with status 12019-05-07T18:54:52.294324+00:00 heroku[worker.1]: State changed from up to crashed2019-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 available2019-05-07T18:54:52.217216+00:00 app[worker.1]: -d64 use a 64-bit data model if available2019-05-07T18:54:52.217218+00:00 app[worker.1]: -server to select the "server" VM2019-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]:
1 回答

斯蒂芬大帝
TA貢獻1827條經(jīng)驗 獲得超8個贊
使用命令啟動進程
java -cp src/BotLottery.java
這對我來說不合適。類路徑為空。它應(yīng)該是一個.jar
或一個.class
文件。不是.java
文件。
添加回答
舉報
0/150
提交
取消