Search code examples
javaibm-cloud

how to deploy standalone java applications (jar's) to bluemix?


There are lots of instructions online for deploying web applications (war files) to Bluemix, but I couldn't find any documentation on deployment of standalone java applications, that are run similar to the following:

java -jar myapp.jar


Solution

  • Runnable jar support was recently just introduced so you can do this.

    All you need to do is have a jar that has a Main method and it will run.

    1. Create an empty directory and place your jar file in it.
    2. Run cf push myappname -p myjarname.jar (replacing myappname with a name for your app)

    Note: If you jar doesn't listen for web traffic your push command should be what is below. This allows the jar to start but not listen for web traffic.

    cf push myappname -p myjarname.jar --no-route