herokujava-homerjb

Can't deploy to Heroku the app with RJB gem


I've set the JAVA_HOME variable

heroku config:add JAVA_HOME=/usr/lib/jvm/java-6-openjdk

checked that heroku config shows this variable with value, then pushed:

git push heroku master

and still get

JAVA_HOME is not set

error while bundler is installing RJB gem.

I can successfully deploy the same source to another Heroku application, and all environment variables are the same.

What is wrong?


Solution

  • I had the same question, and in case anyone else wants to know, this is what Heroku told me:

    By default the config variables aren't made available when the application is compiled - only at runtime.

    You can change this by making sure you have the latest heroku gem install, then enable the user_env_compile lab flag

    $ heroku labs:enable user-env-compile

    this will make JAVA_HOME available when the gem installs, hopefully getting you past this issue.