I'm using heroku with maven to run a server. My goal is to have heroku run the java class server.class as a web dyno.
How would I write a procfile to execute the java program server.class as web?
My current Procfile
web: java -cp $JAVA_OPTS target/classes/v1/a1/server
My error.(From heroku logs)
Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
Error: Could not find or load main class target.classes.v1.a1.server
State changed from starting to crashed
Possibly useful information
The procfile
web: java -cp $JAVA_OPTS target/classes/v1/a1/*
Returns
Error: Could not find or load main class target.classes.v1.a1.myOtherClass
My original Procfile(Also didn't work)
web: java -cp target/classes/:target/dependency/* server
- My file structure is a bit different than the example given in the heroku docs so I modified the procfile a bit.
- My dependencies are not inside /target/dependencies.
- My classes are inside target/classes/v1/a1/.
- server.java has a main method and valid constructor method.
- All my dependencies seem to be in order.
- Maven does builds my .java files into .class files in the target directory.
- I'm on unix so quotes and semicolons probably won't work.