back to all blogsSee all blog posts

Upgrade your cloud-native Java development experience with Liberty Tools for Eclipse IDE

image of author
Adam Wisniewski on Mar 8, 2023
Post available in languages:

Liberty Tools for Eclipse IDE provides a simplified yet powerful development experience. With capabilities like dev mode, Liberty config editing, and Jakarta EE and MicroProfile code assistance, you can code and manage your application without leaving your IDE.

Try it out today by installing from the Eclipse Marketplace.

Check out the following video for a deep dive walk-through of Liberty Tools for Eclipse IDE:

Let’s dive in!

What is Liberty Tools?

Liberty Tools is the next generation IDE tooling for developing cloud-native Java applications with Liberty. It takes an app-centric approach, leveraging the capabilities of the Liberty Maven and Liberty Gradle plugins, so you no longer have to spend time creating and managing Liberty instances. By running dev mode behind the scenes, the Liberty runtime is automatically downloaded and started, and your app is built, packaged, and deployed to it. To save even more time, listeners detect any changes you make, and your app is automatically rebuilt and redeployed without having to restart the runtime.

Keeping in line with the app-centric design, Liberty Tools provides code assistance for both Jakarta EE and MicroProfile APIs. Code completion, hover descriptions, diagnostics and quick-fixes save time, reduce errors, and keep you focused on your code. Liberty Tools accomplishes this by integrating with the Language Server for Jakarta EE and the Language Server for MicroProfile, both open source projects that are continually adding new features and support.

While much of the runtime mechanics are automated with Liberty Tools, some runtime configuration is, of course, necessary. However, this process has been streamlined with config assistance for server.xml, bootstrap.properties, and server.env files. Rather than having to refer to the documentation to find the correct Liberty feature to add or the appropriate value to set for your specific logging attribute, Liberty Tools provides lists of options and descriptions, all without having to leave Eclipse.

Prefer another IDE? Liberty Tools for Eclipse IDE maintains functional parity with plugins for Visual Studio Code and Intellij IDEA.

Requirements

Liberty Tools for Eclipse IDE is designed to work with supported versions of both the IDE for Java EE Developers and the IDE for Java Developers. While Java 17 is needed to run the tool, you can choose a different version of Java to run your application.

Since Liberty Tools uses the Liberty Maven and Liberty Gradle plugins behind the scenes, these plugins must be configured in your application’s pom.xml or build.gradle files. Liberty Tools will also need to run the Maven or Gradle executable which can be accomplished by configuring the Maven and Gradle home in the tool’s preferences, or including a wrapper with the application.

Managing your applications

Any application in your Eclipse workspace that contains src/main/liberty/config/server.xml is automatically enabled to run with Liberty Tools. Actions are available to manage these apps such as Start, Stop, Debug and Run Tests, and you can run these actions from either the Liberty Dashboard or the Eclipse Run As menu.

Liberty Dashboard

The Liberty Dashboard consolidates the Liberty enabled applications in your workspace into a single view. To open the dashboard, click on the Open Liberty UFO icon on the top tray or press Alt + L. To run an action, simply right-click on an app in the list.

Liberty Dashboard

Eclipse Run As menu

Liberty Tools offers the same set of actions in the Eclipse Run As menu that appears when you right click on a project in the Project Explorer view.

Run As menu

Starting your app

To start your application in dev mode, select either the Start or Start…​ actions. The latter opens a Run Configurations dialog box where you can add to the command-line parameters such as additional parameters to dev mode or configure the JRE to use when running the app. When a start action is selected, Liberty Tools opens a Terminal tab and starts dev mode.

Run Configurations
Terminal Start
The Start in container action will start dev mode in a local Docker container and requires 'docker' on the PATH.

Running tests

Tests are important for any application. Liberty Tools makes it easy to run your unit and integration tests by either selecting the Run tests action, or simply clicking Enter in the terminal. You can even view the results of your latest run by selecting View test reports.

Debugging your app

By default, the Liberty runtime is configured with port 7777 for debugging. However, this configuration requires that port to be available on your system and for you to manually attach a debugger. With Liberty Tools, you can start your app using the Debug action, which finds an available port and automatically attaches the Eclipse debugger to it.

Get coding!

Liberty Tools provides coding assistance for Jakarta EE and MicroProfile APIs, as well as select Liberty configuration files.

Jakarta EE

Code completion for Jakarta EE makes it easy to add classes and methods to your app. Just type CTRL + Space from within any Java file to choose from a list of available code snippets. Additionally, diagnostics flag errors and suggest quick-fixes to implement on the spot.

Jakarta code completion
Jakarta quick fix

MicroProfile

Similar code completion is available for MicroProfile, as well as type-ahead suggestions and hover descriptions for MicroProfile Config properties. You can easily see what values are set for injected properties directly from your code and get lists of available variables and values to add to your configuration.

MicroProfile config property hover
MicroProfile code completion

Liberty config editing

Liberty Tools streamlines the process of configuring the Liberty runtime through config completion for server.xml, bootstrap.properties and server.env files. Type CTRL + Space from within these files to get lists of suggested configuration elements, properties, and values.

Server config code completion
Bootstrap properties code completion

Share your feedback

Like what you see? Need support? Find us on Gitter, or open an issue or enhancement on Github.