6

Cloundfoundry recently updated its Java buildpack to version 2.5 (including java 8 and tomcat 8). I still would like to use version 2.4 since my app hasn't been upgraded to java 8 yet. What is the easiest way to do so?

I can push the app using

cf push app -b https://github.com/cloudfoundry/java-buildpack

but how can I specify to use release 2.4 (https://github.com/cloudfoundry/java-buildpack/releases/tag/v2.4)? Apparently specifying the tag URL instead doesn't work.

obecker
  • 2,132
  • 1
  • 19
  • 23

1 Answers1

17

To specify a branch with "cf push -b", put a "#" before the branch name. In your example, you would use

$ cf push app -b https://github.com/cloudfoundry/java-buildpack#v2.4

This might give you some strange messages about the buildpack clone being in "detatched HEAD" state, but that can be ignored.

You should be able to run your app on the Java 8 JRE even though it was compiled with an earlier JDK. Are you getting errors when running your app on the Java 8 JRE?

Use directly the version number in the url - without "tags/": java-buildpack#tags/v2.4 -> java-buildpack#v2.4

masc
  • 27
  • 5
Scott Frederick
  • 4,184
  • 19
  • 22
  • With the new buildpack I've got an exception "Java 1.8 ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet" which seems to be caused by Spring 3.2.X in my project – obecker Sep 30 '14 at 20:05
  • Concerning the # URL: now I'm seeing these errors in the logs: ERR warning: Could not find remote branch tags/v2.4 to clone. ERR fatal: Remote branch tags/v2.4 not found in upstream origin – obecker Sep 30 '14 at 20:07
  • 2
    Alright, I got it: it must be **https://github.com/cloudfoundry/java-buildpack#v2.4** (i.e. "#v2.4" instead of "#tags/v2.4") Thanks! – obecker Sep 30 '14 at 20:15
  • excellent this saved my application from being in a down state because a change to the latest version caused memory issues – mjj1409 Mar 06 '17 at 14:06