Search code examples
javaoracle-databaseherokubuildpack

Oracle JDK 8 on Heroku with a Gradle Build


Does anyone know where I can find a gradle-compatible buildback for Heroku that includes the Oracle Java JDK 1.8?

I'm deploying a reasonably complex spring application and I have a feeling the strange errors are caused by differences between OpenJDK and OracleJDK.

Alternatively, perhaps someone can guide me to forking an existing buildpack and creating my own.

EDIT: It wasn't a JDK issue after all


Solution

  • First of all, this is unlikely to solve your problem. That said...

    You can customize the JDK by setting the JDK_URL_1_8 config var like so:

    $ heroku config:set JDK_URL_1_8=http://...tar.gz
    

    For Oracle JDK: you must strip the jdk1.8.0_51 dir from the tarball. You can do this by running:

    $ tar -xvf jdk-8u51-linux-x64.gz
    $ cd jdk1.8.0_51
    $ tar -cv -f jdk-8u51-linux-x64.gz .
    

    You should manually download the OracleJDK, edit as per above, and put it in a personal S3 bucket (or some other storage). Then use that URL for your config var.

    Be aware that the Oracle JDK is much larger than the OpenJDK (by about 100mb). This will affect your slug size. (The size is mainly due to junk you don't need like GUI stuff and docs).