Downgrading Existing Java Apps to Use Java 7

Last Updated: 29 April 2015

java jdk

Table of Contents

By default, Java apps running on the cedar-14 stack use OpenJDK 8. However, it’s possible to run older versions of the JVM. Follow the instructions below to use OpenJDK 7.

If you have questions about Java on Heroku, consider discussing them in the Java on Heroku forums.


Add to your app

Create a file in the base directory of your app called

Add the property, java.runtime.version=1.7.

Currently, supported versions are 1.6, 1.7, and 1.8. The default is 1.8.


$ git add

$ git commit -m "Adding Java 7 support"

Push your app

$ git push heroku master

You should see Installing OpenJDK 1.7 in your build output, e.g.

-----> Heroku receiving push
-----> Java app detected
-----> Installing OpenJDK 1.7...done