Support for Java 13 Preview Features in IntelliJ IDEA 2019.2

Java 13 is planned for release on September 17, 2019. And IntelliJ IDEA is already getting ready for it! Starting with version 2019.2, IntelliJ IDEA has support for Java 13 Preview features.

Support for Switch Expressions preview feature

As you may already know, the Java 12 preview significantly improved the handling of the traditional switch statement. Java 13 offers a second preview of switch expressions to drop the “break with value” statement in favor of “yield” (JEP 354).

Here is an example of yielding the values from a switch expression:

A switch expression must either complete normally with a value or complete abruptly by throwing an exception. In the cases where you miss yielding a value, IntelliJ IDEA will underline the “switch” keyword and throw an error message indicating that the result is not produced in all execution paths.


Support for Text Blocks preview feature

One more preview feature targeting JDK 13 is text blocks (JEP 355). A text block is a new way to embed a multiline snippet into the Java source code. It enhances readability and gives the developer control over the format.

Let’s take a closer look at text blocks. Up to now a snippet of HTML, XML, SQL, etc. code embedded in a string literal was hard-to-read, not easily editable, and error-prone. The new “two-dimensional” text blocks syntax allows writing the same lines of code without any cumbersome or excessive complexity.
IntelliJ IDEA now understands the syntax of preview text blocks and provides correct highlighting for it.


IntelliJ IDEA 2019.2 supports most of the features applicable to normal string literals also for text blocks, though it’s a work in progress and more goodies can be expected. Now you can, for example, try the ‘Join concatenated String literal’ quick-fix or check the constant value of the concatenation.


The IDE will correctly highlight the code with skipped line terminator between opening and closing delimiters ( “”” ), giving an error message that the new line is missing after an opening quote.


As you may know, working with string literals can be made simpler with IntelliJ IDEA’s language injection features. They provide comprehensive language assistance while you edit the fragments of injected code.

For more details please refer to

How to enable support for Java 13 preview features
To enable this support, set the corresponding Language Level in the Project Structure settings and install the JDK to compile.
At the time this blog-post is written, Java 13 is still not released, so only early access builds are available and their stability, quality, and security are not guaranteed.
JDK 13 Early-Access Builds are available through this link:

IntelliJ IDEA policy of supporting Java preview versions
IntelliJ IDEA is committed to supporting the preview features from the latest Java release and, if possible, the preview features of whatever release is coming next. So v2019.2 will support Java 12 and 13 preview features. Please note that v2019.3 will drop the support for Java 12 preview features as IntelliJ IDEA 2019.3 will be released after the release of Java 13.

Your feedback on the new IntelliJ IDEA features is always welcome!

Happy Developing!

About Olga Klisho

Java Support Engineer at JetBrains
This entry was posted in New Features and tagged , . Bookmark the permalink.

9 Responses to Support for Java 13 Preview Features in IntelliJ IDEA 2019.2

  1. dev dev says:

    Disappointed, Latest IntelliJ IDEA 2019.2 eats a lot of RAM !
    From -Xmx750m to -Xmx2038m, really ?

  2. Venkat says:

    Unable to update to 2019.2 because of the following error:

    29/07 10:05:55 INFO CreateAction.doApply – Create action. File: C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.1.6\jbr\legal\java.xml.crypto
    29/07 10:05:55 INFO Utils.getZipEntry – entryPath: jbr/legal/java.xml.crypto/
    29/07 10:05:55 ERROR Patch.apply – apply failed Unable to create directory jbr/legal/java.xml.crypto/
    at com.intellij.updater.CreateAction.doApply(
    at com.intellij.updater.PatchAction.apply(
    at com.intellij.updater.Patch.lambda$apply$3(
    at com.intellij.updater.Patch.forEach(
    at com.intellij.updater.Patch.apply(
    at com.intellij.updater.PatchFileCreator.apply(
    at com.intellij.updater.Runner.install(
    at com.intellij.updater.Runner.main(

    System Specifications:
    16 GB RAM

  3. Marcos Rossini says:

    What if this is a maven project? I am running with Java 14-loom Early-Aaccess and I am trying to use Source Level as 13 Preview, but I found no configuration in my pom.xml that intellij would correctly define my module settings, It always sets it to Source Level 13 No New language features.

    Here is compile plugin conf:



    Note that running mvn verify on command line works perfectly.

    • Tagir Valeev says:

      Hello! We are sorry for the inconvenience. It seems that your problem is addressed in IDEA-212618. If so then I have good news for you: it was fixed and should be delivered in the next update 2019.2.2.

  4. Ayb says:

    Installed jdk 13. Getting this error with a var declaration:

    Warning:(3, 13) java: as of release 10, ‘var’ is a restricted local variable type and cannot be used for type declarations or as the element type of an array
    Error:(3, 9) java: cannot find symbol
    symbol: class var
    location: class Main13

    javac on the command line works OK. Here is the code:

    public static void main(String[] args) {
    var x = 10;

    The SDK is set to JDK 13, and the compiler level to 11 (that is the highest available choice).

    • olgakli says:

      Please clarify what JDK build do you use when compilation fails? What javac do you use for compilation in this case:
      > javac on the command line works OK

Leave a Reply

Your email address will not be published. Required fields are marked *