Foreman cannot find $JAVA_OPTS

随声附和 提交于 2019-12-08 18:57:27

I suspect you are running on Windows. If so, then you'll have to reference the JAVA_OPTS var like %JAVA_OPTS%. But Heroku will still need the *nix style ($JAVA_OPTS), so I recommend creating a Procfile.win next to your Procfile with the following contents:

web: java %JAVA_OPTS% -cp target/classes:target/dependency/* Main

Then run this to start your app locally:

$ foreman start --procfile=Procfile.win

This is what I did in order to solve the issue:

Seems that the documentation at heroku site is not clear about what operating system are you using. But then I found the answer in the link below:

Heroku Deploy your Java app locally

The original Proc file script whas like this:

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

and I modified it as you can see below:

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

Just as Heroku documentation states.

This solved the problem and I was able to run my app locally

If you're using 'nix, export JAVA_OPTS before running the script that expects it.

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