Trying to install Java on a Rails Heroku app

后端 未结 1 699
深忆病人
深忆病人 2021-01-22 12:35

My Rails app relies on legacy Java code for a piece of its logic. It runs the code via shell commands: javac whatever and then java whatever. However,

相关标签:
1条回答
  • 2021-01-22 13:07

    Try using heroku-buildpack-jvm-common instead of the Java buildpack. So your .buildpacks file will look like this:

    https://github.com/heroku/heroku-buildpack-jvm-common.git
    https://github.com/heroku/heroku-buildpack-ruby.git
    

    It's probably a good idea to put the JVM one before the Ruby one in case javac or java are needed at compile/build time.

    The JVM buildpack is essentially the same as the Java buildpack, but doesn't install Maven and thus does not require a pom.xml file. The missing pom.xml is why you got that error I think.

    EDIT

    In the modern era, you can also run:

    $ heroku buildpacks:add heroku/jvm
    $ heroku buildpacks:add heroku/ruby
    
    0 讨论(0)
提交回复
热议问题