BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JetBrains IntelliJ IDEA 2024.1 Delivers Support for Java 22 Features

JetBrains IntelliJ IDEA 2024.1 Delivers Support for Java 22 Features

JetBrains released IntelliJ IDEA 2024.1 featuring support for Java 22 features, OpenRewrite, WireMock server, the Maven Shade Plugin and full line code completion for Java and Kotlin.

The new release supports Java 22 features such as statements before super(), String Templates and Implicitly Declared Classes and Instance Main Methods. Code written in other languages can be injected into Java's String Templates by using annotations or via Alt+Enter.

The log output has been improved and allows users to click on a certain log message to open the code which generated the log message. This can be configured via Settings/Preferences | Advanced Settings | JVM languages. IntelliJ will also automatically add a Logger initialization statement when typing log.

Project indexing has been improved and IDE features, such as code completion and syntax highlighting, are now available during indexing for Java and Kotlin. IntelliJ now parses the pom.xml files to construct the project model in order to create the project structure in seconds while the rest of the project is built in the background.

The rename feature in the Maven Shade Plugin is now supported and IntelliJ highlights the code and provides navigation.

When adding a breakpoint on a line with multiple statements such as Lambda functions, the IDE displays inline breakpoints which can be enabled individually.

IntelliJ IDEA now shows which statements aren't completely covered by tests including the specific branch of the code which wasn't covered. The feature is enabled by default and may be configured via Settings/Preferences | Build, Execution, Deployment | Coverage.

A new terminal is available as a beta feature and may be enabled via Settings/Preferences | Tools | Terminal | Enable New Terminal. Currently Bash, Zsh and PowerShell are supported and work is ongoing to support other shells. The terminal offers command completion which supports paths, commands, arguments and options. The new command history makes it easier to filter and find commands. The new UI displays each command in a separate block. Navigating between the blocks is possible on Windows and Linux via Ctrl+↑ / Ctrl+↓ and on macOS via ⌘↑ / ⌘↓. Anastasia Shabalina, product manager at JetBrains, wrote this blog post describing all the new terminal features including examples.

Sticky lines in the editor keeps class and method definitions fixed at the top of the editor while scrolling to provide a better context overview.

This release makes it possible to zoom the entire IDE via View | Appearance and then select Zoom IDE.

The Kotlin K2 mode has been introduced for improved performance and better stability during code analysis, using the embedded K2 Kotlin compiler.

JetBrains IntelliJ IDEA 2024.1 uses the official Kotlin style guide for all projects unless overwritten. Next to that, static imports are now kept while copy pasting.

Support for the Scala 3 syntax, autocompletion and debugger has been improved.

While the previous features are available in every IntelliJ edition, the new features in the following paragraphs are only available in the IntelliJ IDEA ultimate edition.

Full line code completion for Java and Kotlin, which suggests entire lines of code based on the context analysis of the file, uses advanced deep learning models running locally without sending code over the internet.

The new AI Assistant requires a JetBrains AI subscription and should be installed as a separate plugin. After installation, the AI assistant can be used for code completion, generating tests and generating commit messages. Code highlighting is now enabled in the AI Assistant responses just like in the editor.

This new version supports OpenRewrite to refactor code and, for example, upgrade to a new version of Java or a new version of a framework.

The WireMock server is now supported via a plugin and offers schema completion for JSON configurations, generation of WireMock stub files and the possibility to run the stub on a server from the editor.

The latest version of IntelliJ IDEA is now available on the JetBrains website and via the JetBrains Toolbox App.

A complete overview of all the changes for IntelliJ IDEA 2024.1 may be found in the What’s New in IntelliJ IDEA 2024.1 article, while the What's New in IntelliJ IDEA 2024.1 video provides a brief overview of the biggest new features. Also, Mala Gupta, developer advocate at JetBrains, described support for the various Java 22 features including examples in a recent blog post and this JetBrains webinar.

About the Author

Rate this Article

Adoption
Style

BT