Over a million developers have joined DZone.

Running Java Apps From Eclipse IDEs in Docker Liberty Containers

Learn how to use a local Eclipse-integrated Liberty server to test code changes and debug Java code almost immediately within a Docker container.

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

Before my vacation I blogged about the Docker tooling in Eclipse to build Liberty based images for Bluemix. This tooling helps to create images and containers, including the applications, which is the end result of what developers produce. But in order for developers to test changes during development, a new image and a new container would have to be created manually after every code change.

Because of that, developers often use the local Liberty server, which is integrated in Eclipse, so that code changes can be tested (almost) immediately and Java code can be debugged. However, in some cases this model might cause issues because of inconsistencies between the local Liberty server configuration and the Liberty version running in the Docker container.

As an alternative, you can configure Eclipse to run your applications from the workspace on a remote Liberty server, which can run in the Docker container. My colleague Kavitha Suresh Kumar has created a video which describes how to use this mechanism.

So in addition to the local Liberty server, I can also run my application now directly on Docker and see code changes immediately.

Unfortunately, I haven't figured out yet how to do remote debugging. There is a capability in the Liberty Eclipse tooling to do this in general but there seems to be a problem in combination with the Liberty container. I'll blog more about this when I'll find out how to use this functionality.

My colleague Soloman Barghouthi describes in the next video yet another alternative to see application changes in Docker containers immediately. He uses an approach to map a drive with the server configuration and web application and make it accessible to Docker.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

liberty ,docker ,websphere ,containers ,cloud ,java

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}