Liberty and Eclipse: Connecting Eclipse to Bluemix

Share this post:

WebSphere Liberty is the next generation application server. Liberty and Eclipse make a great local development environment for developing and deploying Java EE applications to Bluemix, especially to the Liberty for Java instant runtime. Now that we have the Bluemix tools installed and understand the Bluemix deployment concepts, we can use this to connect Eclipse to Bluemix.

In this excerpt from “Java EE, the next inception: Install a local Java EE development environment for Bluemix,” we’ll explore how to connect Eclipse to Bluemix, which will enable us to use Eclipse to deploy Liberty applications to Bluemix. Next, we’ll discuss using Eclipse to push a packaged server to Bluemix.

To start at the beginning of this series, see WebSphere Liberty: Developing Java EE applications for the cloud.

Link Eclipse to Bluemix

You can define servers in Eclipse that link to Bluemix. This enables you to use Eclipse to deploy apps and packaged servers to Bluemix and to interact with the apps that are deployed to Bluemix. To use Eclipse with Bluemix, you’ll need a Bluemix account.

A Bluemix server in Eclipse doesn’t represent all of Bluemix, it represents a particular location, specified by a region, organization, and space. Therefore you need one server in Eclipse for each space in Bluemix to which you want to deploy. For each space, you must authenticate as a user authorized to deploy to that space.

To create a Bluemix server in Eclipse to deploy to your space named “dev,” use the Bluemix tools in Eclipse:

  1. Go to the Servers view by selecting Window > Show View > Servers.
  2. In the Servers view, select New > Server.
  3. On the Define a New Server dialog (Figure 1):
    • Server type: select IBM > IBM Bluemix.
    • Server name: Bluemix – dev.
    • Press Next.
    Figure 1. Define a new server

    Define a new server

  4. In the New Server dialog on the IBM Bluemix Account page (Figure 2):
    • Log into Bluemix (with an account that is authorized to deploy to your dev space).
    • Select the region that hosts the space by selecting the URL for the region’s cf API endpoint. The default is US South’s endpoint.
    • Optional: Press Validate Account to confirm that your credentials work properly.
    • Press Next.
    Figure 2. IBM Bluemix Account

    IBM Bluemix AccountThe region and account are used to log into Bluemix and retrieve the user’s list of organizations and spaces.

  5. On the Organizations and Spaces panel (Figure 3):
    • Organizations and spaces: Select your organization and dev.
    • Press Finish.
    Figure 3. Organizations and spaces

    Organizations and spaces

As a result, the Servers view now lists your Bluemix space, as shown in Figure 4.

Figure 4. Servers view listing a Bluemix server

Servers view listing a Bluemix server

You can now use the server in Eclipse to perform these tasks in Bluemix:

More How-tos stories
May 3, 2019

Kubernetes Tutorials: 5 Ways to Get You Building Fast

Ready to start working with Kubernetes? Want to build your Kubernetes skills? The five tutorials in this post will teach you everything you need to know about how to manage your containerized apps with Kubernetes.

Continue reading

May 3, 2019

Using Portworx to Deploy and Manage an HA MySQL Cluster on IBM Cloud Kubernetes Service

This tutorial is a walkthrough of the steps involved in deploying and managing a highly available MySQL cluster on IBM Cloud Kubernetes Service.

Continue reading

May 2, 2019

Kubernetes v1.14.1 Now Available in IBM Cloud Kubernetes Service

We are excited to announce the availability of Kubernetes v1.14.1 for your clusters that are running in IBM Cloud Kubernetes Service. IBM Cloud Kubernetes Service continues to be the first public managed Kubernetes service to support the latest upstream versions from the community.

Continue reading