How to build and deploy java application using IBM Bluemix plugin for Eclipse IDE

IBM Bluemix™ is a cloud platform that helps developers rapidly build,manage and run web and mobile applications. With IBM Bluemix™, developers can focus on building excellent user experiences with flexible compute options, choice of DevOps tooling, and a powerful set of IBM and third-party APIs and services.

Built on Cloud Foundry open source technology,IBM Bluemix™ makes application development easier with Platform as a Service (PaaS). Bluemix also provides pre-built Mobile Backend as a Service (MBaaS) capabilities.By abstracting lower level infrastructure components,IBM Bluemix™ enables you to spend more of your time and talent writing the code.

You can use IBM Bluemix™ to quickly develop apps in the most popular programming languages. You can develop mobile apps in iOS, Android, and HTML with JavaScript. For web apps, you can use languages such as Ruby, PHP, Java™, Go, and Python et. al

You can deploy an application in IBM Bluemix by three ways either by using Cloud Foundry command line or Git/Jazzhub or by using IBM Bluemix plugin for Eclipse IDE.

The illustration below will help you to build and deploy java application in IBM Bluemix using IBM Bluemix plugin for Eclipse IDE

Prerequisites for building and deploying java application in IBM Bluemix

  1. Open your Bluemix page and click on the CATALOG, Goto Data and Analytics and click on SQL Database

blog_6 2) Add a service name(eg:javadb) and then click on CREATE

blog_73) Click on the LAUNCH button and then you can see the welcome screen. There will be 3 options,click on work with tables.

blog_8

4) Click on the + icon and then edit the DDL statement

blog_9

5) After editing the DDL statement,click on RUN DDL, If all is well, you will receive a message DDL Ran successfully

blog_10

6) After successful creation you can see your table details and also browse the data(if any)

blog_11Now we can move onto Eclipse IDE for pushing our code to Bluemix through the Bluemix plugin

Make sure that you have added Bluemix plugin in your Eclipse IDE or else follow the steps here

After installing the Bluemix plugin for Eclipse IDE, Click on File>New>Other and search for Server. Click on Next

blogblu_1

Then click IBM>IBM Bluemix and click on Next

blogblu_2Enter your Bluemix account details(email and password). Click on Finish

blogblu_3And its added !

blogblu_4

Create a jsp application to insert user’s details into database.

Front end: Input –> FirstName, LastName, Mobile Number and Email Address

For integration with the back end(SQL DB) in Bluemix you have to either hardcode the VCAP_SERVICE environment variable (You can view the credentials by clicking on show credentials) in your code or take it dynamically

blog_12or else do a JNDI look up of the database

blog_jndiOnce after the jsp application is ready,we can push it into bluemix directly from the Eclipse IDE with just one click( another advantage of Bluemix) using IBM Bluemix plugin for Eclipse IDE

Right click on your app in Eclipse IDE, Click on Run As>Run on Server>Cloud>IBM Bluemix and Enter your application name(eg:javadbapps) and Click next

deployblog

Customize the memory limit if required and click on Next

deployapp2

Select the database you wish to bind to your application,here we will bind it using javadb(the one that was created) and then click on FINISH

deployapp3

pushing the application into bluemix

deployapp5

Voila!Its now running in Bluemix

outputYou can now access your application using the unique URL <your_app_name>.mybluemix.net

An application ready within few minutes. Thanks to IBM Bluemix™ for making developer’s life so easy!

Courtesy:IBM Bluemix™(bluemix.net)

Advertisements

2 thoughts on “How to build and deploy java application using IBM Bluemix plugin for Eclipse IDE

  1. Pingback: Java application to send message using Twilio and IBM Bluemix™ | Understanding Technology

  2. Pingback: Java application to send mail using Sendgrid & IBM Bluemix – Understanding Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s