foreman can't find java

假如想象 提交于 2019-12-11 05:49:11

问题


I'm trying to use foreman to run a java app locally which deploys fine to heroku.

My Procfile looks like this

web: java $JAVA_OPTS -cp target/classes;target/dependency/* Start

but when i do formeman start i get

15:51:21 web.1  | unknown command: java $JAVA_OPTS -cp target/classes;target/dependency/* Start

If I just enter java at the prompt i get java's help text back so its on my path. If I use the full path to the java executable in the Procfile it works, but it'd be cleaner if I didn't need two versions of the Procfile

Is there somethinf funky going on with my path or is foreman not getting the path from my environment?


回答1:


Could it be the environment variable is the problem?

Windows:

    java %JAVA_OPTS% -cp target/classes;target/dependency/* Start

Linux:

    java $JAVA_OPTS -cp target/classes:target/dependency/* Start

Looks like the example is a mix of both :-)

Environment variable



来源:https://stackoverflow.com/questions/15390632/foreman-cant-find-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!