Skip to content

Instantly share code, notes, and snippets.

@naaman
Created August 30, 2012 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naaman/1b0a97fd1883ce752ce7 to your computer and use it in GitHub Desktop.
Save naaman/1b0a97fd1883ce752ce7 to your computer and use it in GitHub Desktop.
Adding Java 7 to an Existing App

#How to Add Java 7 to an Existing App

By default, Java apps run on OpenJDK 6. However, it's possible to run on newer versions of the JVM. Follow the instructions below to use OpenJDK 7.

##Prerequisites

##Add system.properties to your app

Create a file in the base directory of your app called system.properties.

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

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

##Commit system.properties

git add system.properties

git commit -m "Adding Java 7 support"

##Update your buildpack

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-java.git#multijdk

##Push your app

git push heroku master

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

-----> Heroku receiving push
-----> Fetching custom buildpack... cloning with git...done
-----> Java app detected
-----> Installing OpenJDK 1.7...done

##Questions/Feedback Please let us know if you have any questions or feedback at http://github.com/heroku/heroku-buildpack-java/issues, or via email (naaman at heroku.com).

@sekharrockz
Copy link

hey i am not using git push commands. i am using system.properties,buildpack and heroku push. but still i am getting errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment