Red Hat CodeReady Studio

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).

Installation

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.

OpenShift

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:

A screenshot of the &quot;Create a URL&quot; dialog.
Figure 1: Create a secured URL in OpenShift's Application Explorer view.

When a URL is displayed in the tree, the icon now has a secure lock indicator, shown in Figure 2:

A screenshot of the URL in a tree, with the secure lock indicator.
Figure 2: The secure lock indicator in the URL tree.

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!

Server tools

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.

Hibernate Tools

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.

Platform

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:

Use the New File wizard to create missing folders
Figure 3: Use the New File wizard to create missing folders.

Text editors

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:

A screenshot of ligatures rendered in the Java editor on Windows 10.
Figure 4: 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:

A screenshot of an open project with the new dark scrollbar.
Figure 5: 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:

A screenshot of the old light theme.
Figure 6: The old light theme.

Figure 7 shows the new light theme:

A screenshot of the new light theme.
Figure 7: The new light theme.

Square tabs for views

By default, the Eclipse IDE now uses square tabs for views, as shown in Figure 8:

A screenshot of the Eclipse IDE with square tabs for views.
Figure 8: The Eclipse IDE now uses square tabs for views.

We also added a preference for users who want to switch back to using round tabs, as shown in Figure 9:

A screenshot of the option to use round tabs.
Figure 9. Users can select the preference for round tabs.

Consistent toolbar colors in dark theme

The toolbar styling in the dark theme is consistent with these updates, as shown in Figure 10:

A screenshot of square tabs in the Eclipse dark theme.
Figure 10: Square tabs in the Eclipse dark theme.

Preferences

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:

A screenshot of the Install/Update preferences page with the option to verify compatible provisioning.
Figure 11: The Install/Update preferences page with the option to verify compatible provisioning.

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:

A screenshot of the error message with incompatible dependencies listed.
Figure 12: The error message lists the incompatible dependencies.

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:

A screenshot of &quot;Rename resources inline&quot; checkbox option.
Figure 13: The 'Rename resources inline' option is now a checkbox.

Debugging

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:

A screenshot of the Import Breakpoints dialog with the new Select All and Deselect All options.
Figure 14: Select All and Deselect All enable faster decisions when importing breakpoints.

General updates

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:

A screenshot of the key binding for the Quick Switch Editor command.
Figure 15: Hover over a command to see the corresponding key binding.

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:

A screenshot of key binding options under the Find Actions dialog.
Figure 16: Key binding options under the Find Actions dialog.

Ant 1.10.8

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 Instanceof (Preview)

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:

A screenshot of the options to set the set the JDK compiler compliance to 14 and enable the preview features.
Figure 17: Set your JDK compiler compliance to 14 and enable the preview features.

Records

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:

A screenshot of the new_record template option.
Figure 18: Use the new_record template to create a record in an empty .java file.

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:

A screenshot of the Record Creation wizard.
Figure 19: The Record Creation wizard.

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:

A screenshot of an open Java project with the &quot;Enable preview features&quot; option selected.
Figure 20: Enable the JDK 14 preview features for a Java project.

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:

Change the default severity level to 'Warning' for potential compilation issues
Figure 21: Change the default severity level to 'Warning' for potential compilation issues.

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 org.eclipse.jdt.ui.content_assist_noUIThread_computation to false. Figure 22 shows the option to enable (or disable) nonblocking completion:

A screenshot of the option to enable or disable nonblocking completion.
Figure 22: 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:

A screenshot of the merge option for unnecessary code.
Figure 23: The merge option for unnecessary code.

As an example, for the code shown in Figure 24:

A screenshot of the The MyClass.java class.
Figure 24: The MyClass.java class before cleanup.

you would get the result shown in Figure 25, following the cleanup:

A screenshot of the MyClass.java class after cleanup.
Figure 25: The MyClass.java class after 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:

A screenshot of the option to use local variable type inference in Java 10 or higher
Figure 26: Use local variable type inference in Java 10 or higher.

As an example, for the code in Figure 27:

A screenshot of the MyClass.java class before cleanup.
Figure 27: MyClass.java before cleanup.

you would get the result shown in Figure 28, following the cleanup:

A screenshot of MyClass.java after cleanup.
Figure 28: MyClass.java after cleanup.

Prefer lazy logical operators

Another new cleanup replaces eager logical operators with lazy operators whenever possible. The cleanup replaces | and & with || and &&, 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:

A screenshot of the option to use the lazy logical operator.
Figure 29: Open the Code Style tab and select 'Use lazy logical operator.

For the code in Figure 30:

A screenshot of MyClass.java before cleanup.
Figure 30: MyClass.java before cleanup.

you would get the results shown in Figure 31, after the cleanup:

A screenshot of MyClass.java after cleanup.
Figure 31: MyClass.java after cleanup.

A quick fix to switch expression

We added a quick fix to convert aswitch expression's return statement to a yield statement, as shown in Figure 32:

A screenshot of the option: &quot;Change to 'yield' statement&quot;.
Figure 32: Convert a switch expression's 'return' statement to a 'yield' statement.

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:

A screenshot of the new settings for record declarations.
Figure 33: How to access the Java formatter's new settings for record declarations.

Debugging

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:

A screenshot of the debugger inspecting synthetic variables.
Figure 34: The JDT debugger flags a synthetic variable.

Figure 35 shows the method after debugging:

A screenshot of the corrected variable.
Figure 35: The corrected variable.

Preferences

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:

-Djdt.codeCompleteSubstringMatch=false

Conclusion

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.

Last updated: March 30, 2023