Chris Snow
Chris Snow

Reputation: 24588

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

Upvotes: 3

Views: 1838

Answers (1)

Jeff Sloyer
Jeff Sloyer

Reputation: 4964

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

Upvotes: 9

Related Questions