JBoss Tools 4.14.0 and Red Hat CodeReady Studio 12.14 for Eclipse 4.14 (2019-12) are here and waiting for you. For this release, we focused on improving container-based development, adding tooling for the Quarkus framework, and fixing bugs. We also updated the Hibernate Tools runtime provider and Java Developer Tools (JDT) extensions, which are now compatible with Java 13. Additionally, we made many UI changes to platform views, dialogs, and toolbars.
In these two articles, I introduce the highlights of these new releases and show you how to get started with using them in your Java projects. Keep reading to learn more about the updates and new features in JBoss Tools 4.14.0. In this first article, I focus on these features:
-
- Red Hat OpenShift Container Platform 4.3 compatibility
- OpenShift Application Explorer view
- OpenShift Application Explorer feedback loop
- New tooling for Quarkus
- Preview: Content assistance for Quarkus
- Conclusion
Installation
First, let's look at how to install these updates. Red Hat CodeReady Studio (previously Red Hat Developer Studio) comes with everything pre-bundled in its installer. Simply download the installer from the Red Hat CodeReady Studio product page and run it as follows:
$ java -jar codereadystudio-<installername>.jar
On the other hand, installing JBoss Tools 4.14.0—aka "bring-your-own Eclipse (BYOE) CodeReady Studio"—requires a bit more effort. This release requires at least Eclipse 4.14 (2019-12), but we recommend installing the latest Eclipse 4.14 2019-12 Java EE bundle. Installing the newest bundle ensures you get the most current Java dependencies.
Once you have Eclipse 4.14 (2019-12) or higher installed, you can open the Eclipse Marketplace tab and look for either JBoss Tools or Red Hat CodeReady Studio. Alternatively, you could download JBoss Tools 4.14.0 directly from our update site.
OpenShift Container Platform 4.3 compatibility
JBoss Tools is now compatible with OpenShift Container Platform (OCP) 4.3. You can now access the new release in JBoss Tools by defining your connection to an OpenShift Container Platform 4.3 cluster, just as you did before for an OpenShift Container Platform 3 cluster.
OpenShift Application Explorer view
We've also added a new OpenShift Application Explorer view, in addition to the standard OpenShift Explorer. Based on OpenShift Do (odo), the new view simplifies user experience and introduces feedback loops and an improved debugging console.
To see the new view in action, open your JBoss Tools 4.14.0 workspace. You should see OpenShift Application Explorer in the list of views available on the bottom part of the screen, as shown in Figure 1.
![img_5e6f29efe18e9 A screenshot of the new OpenShift Application Explorer view.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f29efe18e9.png?itok=x8ameXtN)
If the view is not automatically listed, you can find it using Window -> Show View -> Other. From the Other window, type open
in the provided textbox, then select OpenShift Application Explorer from the JBoss Tools drop-down list, as shown in Figure 2.
![img_5e6f2a3693aa9 A screenshot of the JBoss Tools drop-down list with the option to select OpenShift Application Explorer.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2a3693aa9.png?itok=_Dv7X6Vy)
You'll see OpenShift Application Explorer in a new tab, as shown in Figure 3.
![img_5e6f2a876a32d A screenshot of OpenShift Application Explorer in its own tab.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2a876a32d.png?itok=kIDzE1hG)
Expanding the root node will display the list of projects available on the OpenShift Container Platform cluster, as shown in Figure 4.
![img_5e6f2ac7e681d A screenshot of the expanded directory with a single project folder.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2ac7e681d.png?itok=3AaQZtYe)
OpenShift Application Explorer feedback loop
We also added a new feedback loop feature, which gives you fast feedback on code changes. To best understand this feature, it helps to create a sample application. Once you have created the sample application, continue here.
Now that you have the new OpenShift Application Explorer open and running let's try it out with an example application.
Develop a Java-based microservice with JBoss Tools 4.14.0
In this section, I'll show you how to use OpenShift Container Platform 4.3 and the new OpenShift Application Explorer in JBoss Tools 4.14.0. We'll use these tools to develop a Java-based microservice.
Before we start working on the application, we need to load the component source code into our workspace. To start, click Ctrl+N and select the Launcher project wizard from the drop-down list, as shown in Figure 5.
![img_5e6f2b018dacf A screenshot showing the Launcher project wizard selected in a drop-down list.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2b018dacf.png?itok=_r83h2ME)
Click Next, then enter the following information in the given fields:
- Type
rest-http
in the Mission field. - Type
vert.x community
in the Runtime field. - Type
myservice
in the Project name field.
Figure 6 shows these entries.
![img_5e6f2b77aee89 A screenshot of the project-generation page, where you will use the Mission, Runtime, and Project name fields to define the project.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2b77aee89.png?itok=bm83nhHX)
Click Finish to add the new project to your workspace. Once the dependencies are resolved, we can start playing with the cluster.
Step 1: Create a new microservices component
The first thing we'll do is create the microservices component. From OpenShift Application Explorer, right-select myproject, then click New -> Component. This action will lead you to the Create a component window shown in Figure 7.
![img_5e6f2bab5d504 A screenshot of the 'Create a component' window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2bab5d504.png?itok=sDhQL8OQ)
In the Name field, enter myservice
, then click the Browse button to select the new project you've just created. In the Component type field, select java
. In the Component version field, select 8
. Finally, enter myapp
in the Application field, then uncheck the Push after create checkbox. All of these selections are shown in Figure 8.
![img_5e6f2bc87bc7e A screenshot of the 'Create a component' window with the selections described.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2bc87bc7e.png?itok=JdiYyi3R)
Click Finish to create the component, then expand the project node to view the application. That view is shown in Figure 9.
![img_5e6f2be695a75 A screenshot of the expanded project node for the example application.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2be695a75.png?itok=YqsXI6G1)
Expanding the application displays the new component, as shown in Figure 10.
![img_5e6f2c02589a2 A screenshot of the expanded project node, showing the new component nested under 'myapp'.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2c02589a2.png?itok=D-xgonRD)
Step 2: Build and deploy the component
We've created the myservice
component, but note that we unchecked the Push after create checkbox. We'll have to deploy the component on our cluster manually. Deploy it by right-selecting the component and clicking the Push button. OpenShift Container Platform will create the deployment and launch a build.
Once that's done, you'll see a new window created in the Console view. After a while, you should see the output in Figure 11.
![img_5e6f2c20bd567 Build output shows the component has been successfully deployed.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2c20bd567.png?itok=4mqEBQ6F)
Step 3: Define a URL
The component is now deployed to the cluster, but we cannot yet access it. Our next step is to define a URL that allows us to access the component externally. Right-select the component and click New -> URL, as shown in Figure 12.
![img_5e6f2c483cc8b Screenshot of the new window to create a URL for external access to the component.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2c483cc8b.png?itok=4qqkFj8n)
Enter url1
in the Name field and select 8080
in the Port field, as shown in Figure 13.
![img_5e6f2c68bdf18 A screenshot of the new window to configure the URL endpoint.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2c68bdf18.png?itok=0XI8_qoK)
Now click Finish.
Step 4: Synchronize the configuration
We have created the URL, but it's not yet live on the OpenShift Container Platform cluster. Pushing the component out again will synchronize the local configuration with the configuration on the cluster. In Figure 14, a message in the Console view informs us that the push is required.
![img_5e6f2c935a857 A screenshot of the console window with instructions for creating the URL.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2c935a857.png?itok=7L24cgjb)
To push the component out again, click component -> Push.
Step 5: Test the new microservice
Let's check that we can now access the service. Expanding the component to one more level lets us see the URL we've just created, as shown in Figure 15.
![img_5e6f2cbc534fa A screenshot of the OpenShift Application Explorer view showing the application directory. The new URL is shown under the 'myservice' component.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2cbc534fa.png?itok=629Nug5M)
Right-select the URL and click Open in Browser. You should now see a new browser window, as shown in Figure 16.
![img_5e6f2cefea1b1 A screenshot of the new service open in a browser window. The service includes a text box and a button labeled 'Invoke'.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2cefea1b1.png?itok=3bBUWwMz)
To test the service, enter demo
in the text box, then click Invoke. You'll see a new screen for the service, as shown in Figure 17.
![img_5e6f2d0a3c56b A screenshot of the new service after clicking the 'Invoke' button. The screen shows the output 'Hello, demo!'](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2d0a3c56b.png?itok=9rYC7kbc)
With just a few configurations, we have a new microservice up and running on OpenShift Container Platform. Next, I'll introduce two additional features available in OpenShift Application Explorer: A feedback loop that lets you quickly see the results of code changes, and the new debugging console.
Create the feedback loop
Now that we have an example application to work with, we can explore the new feedback loop in OpenShift Application Explorer. Let's modify the example application's code and try it out.
In the Project Explorer tab, locate the HttpApplication.java
file, which is shown in Figure 18.
![img_5e6f2dfeb5da7 A screenshot of the Project Explorer view showing the HttpApplication.java file in the project directory.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2dfeb5da7.png?itok=CKJOVvOS)
Double-click on the file to open it in a new editor window, as shown in Figure 19.
![img_5e6f2e1596280 A screenshot of the source code in the HttpApplication.java file.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2e1596280.png?itok=7iZSMiO1)
On line 14, change:
protected static final String template = "Hello, %s!";
to:
protected static final String template = "Hello, %s!, we modified the code";
When you're done, press Ctrl+S to save the file.
Now, right-click the service component (myservice
) and click Push. Doing this sends your changes to the cluster, where the component will be rebuilt with your code changes. After a few seconds, the component will be available again, as shown in Figure 20.
![img_5e6f2e85ecd1c A screenshot of console output showing that the build was successful.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2e85ecd1c.png?itok=vgUJ3LZ4)
Return to the browser window and refresh it. Enter demo1
in the textbox (changing the value in this field avoids reloading the cached version), then click Invoke. Figure 21 shows the resulting screen.
![img_5e6f2ea5e9d36 A screenshot shows the new message in the HttpExample application UI: 'Hello, demo1!, we modified the code.'](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2ea5e9d36.png?itok=_iKFibUq)
While our change was straightforward, it's enough to demonstrate the new feedback loop. We were able to modify the code for our example microservice, synchronize the changes with a push to the cluster, and then get rapid feedback by simply refreshing the service in a browser.
Note: If you don't want to manually push code changes back to the cluster, you could opt to automatically synchronize to the cluster with a watch action. If you set a watch action, a new build will be launched automatically on the cluster each time you change the code on your workstation.
Test the feedback loop in the debugging console
Testing an application with a quick feedback loop is a great achievement, but for more complex applications, we also need to understand how the code behaves. In this section, we'll use OpenShift Application Explorer's debugging console to debug the application live on the cluster.
To start, we'll set a breakpoint in the application code. Select the HttpApplication.java
file, then scroll down to the greeting()
method, which is shown in Figure 22.
![img_5e6f2ee257bbc A screenshot of the HttpApplication.java file.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2ee257bbc.png?itok=zRiWlnkc)
Find line 41, then double-click that number in the left-hand ruler column. Doing that sets the breakpoint, as shown in Figure 23.
![img_5e6f2efca6a57 Double-clicking the left-ruler column sets the breakpoint, which is shown in this screenshot.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2efca6a57.png?itok=KXYNRjFq)
We are now ready to debug the application. To start, we need to launch a local debugger (a Java debugger, in this case), which will connect to our application on the cluster. Right-select myservice
in the console, then click Debug. As shown in Figure 24, this initiates port forwarding, which will allow our local debugger to connect to the remote Java virtual machine (JVM).
![img_5e6f2f183150d A screenshot of output following the 'debug' command.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2f183150d.png?itok=y8DZu5qf)
Next, we'll check that we can debug the application. Select the browser window again, enter demo2
in the textbox, and click Invoke. When the debugger hits the breakpoint at line 41, you'll be asked if you want to switch to the Debug perspective, as shown in Figure 25. (Note that you might not see this message if you've previously selected the Remember my decision option.)
![img_5e6f2f30dff16 A screenshot with the option to select the Debug perspective.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2f30dff16.png?itok=gKZy2svP)
When you click the Switch button, you will see the Debug perspective, as shown in Figure 26.
![img_5e6f2f4acd30b A screenshot of the new Debug window with the HttpExample application code.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2f4acd30b.png?itok=oKDrPgdb)
You can now debug the Java component running on a remote cluster in the same way that you would if it was running locally on your workstation.
Note: We used a Java-based component for this example, but JBoss Tools also supports the debugging console for Node.js-based components.
New tooling for Quarkus
With JBoss Tools 4.14.0, we've also added new tooling for applications built on top of the supersonic, subatomic Java-based framework, Quarkus. In this section, we'll set up and debug an example application using the new tools.
Step 1: Create a new Quarkus project
We've added a wizard for creating a new Quarkus application project in your JBoss Tools workspace. To get started with it, click Ctrl+N to get the list of available wizards, shown in Figure 27.
![img_5e6f2fa5cfc97 A screenshot of the drop-down list to select a new project wizard.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2fa5cfc97.png?itok=nTLzUlbG)
In the text box, enter qu
. Doing this filters the list of wizards for Quarkus, as shown in Figure 28.
![img_5e6f2fc0c5a25 A screenshot of the drop-down list of available wizards, now filtered for Quarkus.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2fc0c5a25.png?itok=w4pZ_HT-)
After you select the Quarkus Project wizard, click the Next button. This leads to the Project type screen shown in Figure 29.
![img_5e6f2fe1aac90 A screenshot of the 'Project type' window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f2fe1aac90.png?itok=9ysxiOvE)
This screen invites you to choose either Maven or Gradle for managing your project. We'll use Maven for this example.
After you've selected Maven, enter a project name (code-with-quarkus
), then click Next. The dialog shown in Figure 30 asks you to define project coordinates such as group ID, artifact ID, and the version number for your application, as well as information about your REST endpoint. Defaults are already filled in, so we can just accept these and click Next.
![img_5e6f300bb7efc A screenshot of the dialog to define your new Quarkus project.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f300bb7efc.png?itok=bS6fmaro)
Then, you'll be asked to select the Quarkus extensions you want for your project. As shown in Figure 31, the extensions are grouped by category. We'll select the Web category.
![img_5e6f302b79029 A screenshot of the Quarkus extensions page, showing a list of categories for extension types.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f302b79029.png?itok=Bt2PBIDz)
Now, you see the list of extensions shown in Figure 32. If you want to add an extension, double-click on it.
![img_5e6f3046c5b83 A screenshot of the Quarkus extensions page showing a list of available extensions for the web category.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f3046c5b83.png?itok=Myku-jGT)
As shown in Figure 33, we'll select the RESTEasy JAX-RS and RESTEasy Qute extensions. (Note that RESTEasy Qute is a templating engine.)
![img_5e6f306372ba6 This screenshot shows the 'RESTEasy Qute (Experimental)' extension has been selected.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f306372ba6.png?itok=24tBth_B)
You should see that the extensions you've selected have been added to the table on the far-right side of the screen. If you want to remove an extension from your list, just double-click it again in either of the tables where it appears.
We're done setting up the project, so click Finish. The project will be launched, and its dependencies will be retrieved. After a while, you'll see the new project in your Project Explorer view, as shown in Figure 34.
![img_5e6f307f9466a A screenshot of the new project window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f307f9466a.png?itok=gdbVT1Ei)
We've successfully created a new Quarkus project. Next, I'll show you how to build and run the Quarkus application.
Step 2: Build and run the Quarkus application
Select Run-->Run Configurations… to display the dialog shown in Figure 35.
![img_5e6f30ac48f1c A screenshot of the run configuration page with options to configure the application launch settings.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f30ac48f1c.png?itok=i9y7Wt4a)
Scroll down to Quarkus Application and select that option, as shown in Figure 36.
![img_5e6f30d70f70e A screenshot shows the 'Quarkus Application' option in the left-side toolbar.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f30d70f70e.png?itok=AyITBD72)
Select the New configuration option, as shown in Figure 37.
![img_5e6f30f50f6a6 A screenshot shows the 'New configuration' option under 'Quarkus application'.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f30f50f6a6.png?itok=ya50dbFt)
Next, you need to associate a workspace project with the configuration, so click Browse. You will see a single project, as shown in Figure 38.
![img_5e6f31297ad14 A screenshot shows the 'code-with-quarkus' project has been selected.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f31297ad14.png?itok=tCetJkEb)
Because the workspace contains a single project, it has been automatically selected. Click OK, and you will move to the dialog shown in Figure 39.
![img_5e6f3146d9d1a A screenshot shows the new configuration page for code-with-quarkus.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f3146d9d1a.png?itok=Hd4RC10T)
The configuration needs to be built before we can use it, so start that process by clicking Run. The new Console view shows the build output, as displayed in Figure 40.
![img_5e6f316900efd A screenshot shows the console in a new tab, with build output.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f316900efd.png?itok=iFRBLaDu)
At this point, the application is being built. After a while, it will be started. Figure 41 shows the remaining build output.
![img_5e6f319632dee A screenshot shows the console with build output.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f319632dee.png?itok=OvZfoS3j)
Step 3: Debug the Quarkus application
Debugging a Quarkus application is simple: All we need to do is launch the new configuration we've just created in Debug. Select the Run -> Debug Configurations menu option, then click Debug.
Doing this connects a remote JVM debug configuration to your running Quarkus application. If you've set breakpoints in your application code (like we did in the Java microservices demo), then the execution will automatically stop on the first breakpoint.
Preview: Content assistance for Quarkus
I've shown you how to create, run, and debug a Quarkus application using the new tooling features introduced in JBoss Tools 4.14.0. I also want to introduce a feature that is scheduled for integration with our next JBoss Tools release: Content assistance with the application.properties
file. that you can begin experimenting with now.
The application.properties file
Every Quarkus application is configured using the application.properties
file. The content of application.properties
depends on the Quarkus extensions you've selected for your application. Some settings are mandatory, and some are not. The possible values for each setting are specific to its nature; for instance, you might have boolean
, integer
, or a limited set of values (enumerations).
As a developer, it's up to you to study the guides and documentation for your project and its extensions. Starting with JBoss Tools 4.14.0, you can also find content assistance for specific files under Quarkus Tools. Content assistance is provided for tools that validate the content of your application.properties
files, and that feature provides possibly setting names and values.
To see the new content assistance feature in action, go to src/main/resources/application.properties
in the example project we just created. Right-click the application.properties
file and select Open With -> Generic Text Editor. The Text Editor view is shown in Figure 42.
![img_5e6f31df1ebd6 A screenshot of the application.properties file open in an editor window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f31df1ebd6.png?itok=UzBMZkLl)
Go to the third line of the file shown in Figure 43 and enter Ctrl+Space. Doing this invokes code completion, as shown in Figure 43.
![img_5e6f31f8ee158 A screenshot of the code completion window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f31f8ee158.png?itok=PYLOvMn4)
Mouse over a setting to display its documentation. As an example, try adding quarkus.http.port
to the application.properties
file, then mouse over it. The resulting documentation is shown in Figure 44.
![img_5e6f3215986c7 A screenshot of documentation for the quarkus.http.port setting.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f3215986c7.png?itok=t9EE7Vnw)
If you enter a wrong value, such as entering false
instead of a numeric value, the content assistant will highlight the error, as shown in Figure 45.
![img_5e6f323b371f7 A screenshot shows the 'false' value highlighted in the editor window.](/sites/default/files/styles/article_floated/public/blog/2020/03/img_5e6f323b371f7.png?itok=K7DxIIR8)
The new content assistant is the first of a set of features that will be integrated into the next version of JBoss Tools. We encourage you to use it, and if you find we're missing features or enhancements, don't hesitate to report them using the JBoss Tools issue tracker.
Conclusion
These are only some of the new and updated features available through JBoss Tools 4.14.0 and Red Hat CodeReady Studio 12.14 for Eclipse 4.14 (2019-12). This article addressed the features related to OpenShift Container Platform, OpenShift Application Explorer, and Quarkus. The next article will focus on:
- Hibernate Tools updates.
- Forge, JST, and VPE last updates before deprecation.
- Platform changes to views, dialogs, and toolbars.
- Many general updates.