New features in Red Hat CodeReady Studio 12.16.0.GA and JBoss Tools 4.16.0.Final for Eclipse 2020-06
JBoss Tools 4.16.0 and Red Hat CodeReady Studio 12.16 for Eclipse 4.16 (2020-06) are now available. For this release, we focused on improving Quarkus– and container-based development and fixing bugs. We also updated the Hibernate Tools runtime provider and Java Developer Tools (JDT) extensions, which are now compatible with Java 14. Additionally, we made many changes to platform views, dialogs, and toolbars in the user interface (UI).
This article is an overview of what’s new in JBoss Tools 4.16.0 and Red Hat CodeReady Studio 12.16 for Eclipse 4.16 (2020-06).
First, let’s look at how to install these updates. 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
Installing JBoss Tools 4.16.0—aka “bring-your-own Eclipse (BYOE) CodeReady Studio”—requires a bit more effort. This release requires at least Eclipse 4.16 (2020-06), but we recommend installing the latest Eclipse 4.16 2020-06 Java EE bundle. Installing the newest bundle ensures that you get the most current Java dependencies.
Once you have Eclipse 4.16 (2020-06) 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.16.0 directly from our update site.
In the next sections, we’ll look at updates for the new Red Hat OpenShift 4.5 release and improvements to Quarkus and container-based development. We’ll also look at updates to the Hibernate Tools runtime provider, and to the Java Developer Tools package for JDK 14.
Everything you need to grow your career.
With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.SIGN UP
We’ve added secure URL support and support for the new Red Hat OpenShift Container Platform 4.5 to this release.
Secure URL support
It is now possible to create secured URLs in OpenShift’s Application Explorer view. If you select this option, the created URL will be accessible through
https, as shown in Figure 1:
When a URL is displayed in the tree, the icon now has a secure lock indicator, shown in Figure 2:
OpenShift Container Platform 4.5
Red Hat OpenShift Container Platform (OCP) 4.5 is now available, and JBoss Tools is transparently compatible with this major release. Just define your connection to your OCP 4.4-based cluster the same way that you did for an OCP 3 cluster, and use the tooling!
We’ve made one update to the server tools for this release, adding a server adapter for WildFly 20. The new server adapter adds support for Java EE 8, Jakarta EE 8, and MicroProfile 3.3.
We made the following additions and updates to the available Hibernate Tools runtime providers:
- The Hibernate 5.4 runtime provider now incorporates Hibernate Core version 5.4.17.Final and Hibernate Tools version 5.4.17.Final.
- The Hibernate 5.3 runtime provider now incorporates Hibernate Core version 5.3.17.Final and Hibernate Tools version 5.3.17.Final.
We made many changes to platform views, dialogs, and toolbars in the UI, which I’ll discuss in the next sections.
Views, dialogs, and toolbars
You can now use the New File wizard to create missing folders directly, without explicitly creating folders beforehand. The screenshot in Figure 3 shows the New File wizard:
Linux and Mac OS already supported this feature, and now we’ve added support for font ligatures on Windows in Eclipse. Use the following preference to specify the font with ligatures that you want for your text editors:
General > Appearance > Colors and Font > Basic > Text Font
Figure 4 shows a screenshot of ligatures rendered in the Java editor on Windows 10:
Themes and styling
The Eclipse dark theme now uses the Windows-native dark scrollbars. We also retired the software solution for the editor area. Figure 5 shows an open project with the new dark scrollbar:
Eclipse Windows toolbar styling aligned with Windows 10
We updated the default Eclipse light theme to align better with Windows 10’s default theme. Figure 6 shows the old light theme:
Figure 7 shows the new light theme:
Square tabs for views
By default, the Eclipse IDE now uses square tabs for views, as shown in Figure 8:
We also added a preference for users who want to switch back to using round tabs, as shown in Figure 9:
Consistent toolbar colors in dark theme
The toolbar styling in the dark theme is consistent with these updates, as shown in Figure 10:
We’ve made a number of changes and additions to the platform preferences.
Verify installation operations against the current JRE
On by default, the Verify provisioning operation is compatible with current running JRE option is available from the Install/Update preferences page. This option enables extra checks when installing, updating, or uninstalling content that is required to run the IDE. It uses the standard dialogs to report an error. If any newly installed unit requires a different Java runtime from the one that’s currently in use, the operation will fail with a useful message. Figure 11 shows the Install/Update preferences page with the new option:
Figure 12 shows the error message after attempting to install a unit that requires Java 14 while running the Eclipse IDE with an older Java version:
Renaming resources inline
We added the option to either rename resources inline or use a dialog to rename them in the 4.15 release. Until now, it has been available as a radio button, but we changed it to a checkbox, as shown in Figure 13:
We added Select All and Deselect All buttons to the Import breakpoints wizard for debugging. You can now use these buttons to select or deselect all the breakpoint markers when importing breakpoints, as shown in Figure 14:
Two general updates are worth sharing.
Show key bindings when invoking a command
For presentations, screencasts, and for learning purposes, it is very helpful to show the corresponding key binding when invoking a command. We added that feature some releases ago, as shown in Figure 15:
With the 4.16 release, it is now possible to enable this feature separately or together for keyboard interactions and mouse clicks. You can enable the feature for mouse clicks only, for keyboard interactions only, or for both. Showing key bindings only for mouse clicks is helpful for users who want to learn the existing key bindings.
Enable the Show key binding when command is invoked feature via the Preferences dialog on the General > Keys preference page. Use the command Toggle Show Key Bindings to change this setting quickly. Figure 16 shows this option under the Find Actions dialog:
Eclipse has adopted Ant version 1.10.8.
Java Development Tools (JDT)
The most significant Java Development Tools update is support for Java 14. Eclipse JDT now supports Java 14 for the Eclipse 4.16 release. The release notably includes the following Java 14 features:
- JEP 361: Switch expressions (Standard)
- JEP 359: Records (Preview)
- JEP 368: Text blocks (Second Preview)
- JEP 305: Pattern matching for
Note: The Preview option should be on for preview language features. For an informal introduction to the support, refer to the Java 14 examples wiki.
How to set your JDK compliance to 14
As shown in Figure 17, you can use Preferences > Java > Compiler to set your JDK compiler compliance to 14 and then enable the preview features:
You can create a new record in one of two ways: Using a template or using the Record Creation wizard.
Use a template to create a new record
You can use the
new_record template to create a record in an empty
.java file, as shown in Figure 18:
Use the Record Creation wizard
Alternatively, you can use the Record Creation wizard:
- Right-click on the Project > New > Record.
- Right-click on the Project > New > Other and search for Record.
- Right-click on the Project > New > Other > Java > Record.
The Record Creation wizard comes up, as shown in Figure 19:
Note: In older workspaces, the Record entry may not appear directly under the New menu in the Java perspective. You can resolve this by either using a new workspace or launching Eclipse with the option
-clearPersistedState for your existing workspace.
How to enable the JDK 14 preview features
You can quickly enable the JDK 14 preview features for an applicable Java project by right-clicking on the project and selecting Configure > Enable preview features, as shown in Figure 20:
As shown in Figure 21, you can also use the opened Project properties dialog to change the default severity level to “Warning” for compilation issues with the preview features:
Updates to the Java editor
We’ve made a handful of updates to the Java editor, some of them to accommodate the new preview features.
Nonblocking Java code completion
By default, code completions in the Java editor are now configured to be computed (when possible) in a separate non-UI thread. This configuration prevents UI freezes in case of long computations.
If you want to restore the legacy behavior, the path is Preferences > Java > Editor > Content Assist > Advanced, where you would uncheck the Enable nonblocking completion checkbox. Integrators can change the value of the
false. Figure 22 shows the option to enable (or disable) nonblocking completion:
Merge control workflows
When it’s possible, a new cleanup merges conditions of
if/else if/else that have the same blocks. An
else block could be different and therefore, won’t be merged. One condition might be made opposite to allow the merge. The conditions are merged with
|| to keep the control workflow the same. Adding a parenthesis avoids the priority issue. We’ve kept most of the brackets, formatting, and comments.
To select the cleanup, invoke Source > Clean Up and use a custom profile. Select the Unnecessary Code tab on the Configure dialog. Select Merge conditions of if/else if/else that have the same blocks. Figure 23 shows the merge option for unnecessary code:
As an example, for the code shown in Figure 24:
you would get the result shown in Figure 25, following the cleanup:
Local variable type inference
Another new cleanup uses the
var keyword for the local variable whenever possible. Note that this cleanup is enabled only for Java 10 and higher.
The cleanup replaces the explicit variable type with
var when this type can be known by the variable initialization. It also replaces the diamond operator in instance creation with a parameterized type. Eventually, the cleanup adds a suffix to the initialization number literal to match the variable type. In any case, the variable type remains exactly the same.
To select the cleanup, invoke Source > Clean Up and use a custom profile. On the Configure dialog, open the Code Style tab, then select Use the local variable type inference, as shown in Figure 26:
As an example, for the code in Figure 27:
you would get the result shown in Figure 28, following the cleanup:
Prefer lazy logical operators
Another new cleanup replaces eager logical operators with lazy operators whenever possible. The cleanup replaces
&&, respectively. It only does so when operands such as assignments, increments, decrements, object creations, or method calls won’t cause a side-effect. If an operand could cause a side-effect, the cleanup will keep the eager operator. It also leaves binary operations unchanged.
To select the cleanup, invoke Source > Clean Up and use a custom profile. In the Configure dialog, open the Code Style tab, then select Use lazy logical operator, as shown in Figure 29:
For the code in Figure 30:
you would get the results shown in Figure 31, after the cleanup:
A quick fix to switch expression
We added a quick fix to convert a
return statement to a
yield statement, as shown in Figure 32:
The Java formatter
The Java formatter has new settings that support record declarations. These settings are similar to existing settings related to other type declarations. To see them all, use the Filter field and type in the keyword
record, as shown in Figure 33:
The JDT debugger is now capable of inspecting synthetic variables that are generated by Java compilers. As an example, let’s say that we needed to debug the method
java.util.stream.ReferencePipeline.filter(Predicate<? super P_OUT>) and inspect the predicate variable. Figure 34 shows the method before debugging:
Figure 35 shows the method after debugging:
We’ve removed the Show Substring Matches option from the JDT’s content assist preference option. The feature is now enabled and always on by default. Use the VM property to disable it:
As you can see, we made a wide range of additions and improvements in JBoss Tools 4.16.0 and Red Hat CodeReady Studio 12.16 for Eclipse 4.16 (2020-06). This update includes a bit of something for everyone. You can find more noteworthy updates on this page.