0

Following is my Procfile

web: java %JAVA_OPTS% -cp target\classes;"target\dependency\*"

But Im getting the following error when Im running my web app in heroku.

Error: Could not find or load main class console

The Main.class is inside the package info.socket.webmobile

The application is crashing when I type heroku open and it throws the error Error: Could not find or load main class console when Im running it like heroku run java console

How can I be able to sort this out?

  • where is the class name in the command? – sidgate Jul 20 '16 at 13:01
  • wont it fetch the entire class files and detect the corresponding main class when I say `dependency/*` ? if not how can I include my main class that has got its name as Main.class –  Jul 20 '16 at 13:03
  • `java %JAVA_OPTS% -cp target\classes;target\dependency Main.class ` – sidgate Jul 20 '16 at 13:06
  • ok let me try it. Should include package name as well? –  Jul 20 '16 at 13:08
  • ok thank you so much. now it doesnt give that error message but it throws other error message like `bash: line 0: fg: no job control bash: targetdependency: command not found` –  Jul 20 '16 at 13:10

1 Answers1

0

Your Procfile should contain this:

web: java $JAVA_OPTS -cp target/classes;target/dependency/* info.socket.webmobile.Main

Note that I've add the info.socket.webmobile.Main class, and converted the format to a more *nix friendly format.

codefinger
  • 10,088
  • 7
  • 39
  • 51