简体   繁体   English

Heroku Procfile | 爪哇| 无法找到或加载主类

[英]Heroku Procfile | Java | Could not find or load main class

I try using worker: java com.xditya.Main in the Procfile to run the main file on heroku, and end up with a Could not find or load main class error, on heroku .我尝试使用worker: java com.xditya.MainProcfile运行在Heroku上的主要文件,并与最终Could not find or load main class错误,在Heroku。

My repo structure: src/main/java/com/xditya/Main.java .我的回购结构: src/main/java/com/xditya/Main.java

  • My code is perfectly working.我的代码运行良好。
  • The above mentioned command works fine on my local machine, I face this error only on heroku.上面提到的命令在我的本地机器上运行良好,我只在 heroku 上遇到这个错误。
  • I've tried using it as worker: java -cp . com.xditya.Main我试过用它作为worker: java -cp . com.xditya.Main worker: java -cp . com.xditya.Main , following some tutorials, and still end up with the same error. worker: java -cp . com.xditya.Main ,遵循一些教程,但仍以相同的错误告终。

The repository I'm talking about can be found here .我正在谈论的存储库可以在这里找到。

Solved.解决了。 I dockerised the project.我对项目进行了docker化。 For the ones in need of the same help, please refer to this commit .对于需要相同帮助的人,请参阅此提交

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM