The error message is produced by an outdated version of CheckStyle.

According to the CheckStyle ticket Support for Java 15 Strings you need at least CheckStyle version 8.36 if you want to use text blocks / multiline strings together with CheckStyle checks.

The error message (org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check) indicates that your project uses the Maven-CheckStyle-Plugin version 2.17 which according to Maven Checkstyle Plugin Releases History by default uses CheckStyle version 6.11.2

You can try to configure your project to use the Maven CheckStyle Plugin 2.17 together with the CheckStyle version 8.36 using the following configuration (source: Upgrading Checkstyle at Runtime):

<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.17</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.36</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  ...
</project>
Answer from Thomas Kläger on Stack Overflow
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › lang › String.html
String (Java SE 17 & JDK 17)
April 21, 2026 - The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
🌐
GitHub
github.com › openjdk › jdk17 › blob › master › src › java.base › share › classes › java › lang › String.java
jdk17/src/java.base/share/classes/java/lang/String.java at master · openjdk/jdk17
* string literals in Java programs, such as {@code "abc"}, are · * implemented as instances of this class. * <p> * Strings are constant; their values cannot be changed after they · * are created. String buffers support mutable strings.
Author: openjdk
🌐
DEV Community
dev.to › msmittalas › new-way-to-use-strings-in-java-17-2i1l
New way to Use Strings in Java 17 - DEV Community
June 10, 2022 - Before Java 15, Writing SQL, HTML, JSON or any Polyglot scripts in String were difficult. It was ugly and difficult to read. For example : Following HTML in Java : ... With "JEP 378: Text Blocks" introduced in Java 15 ( Java 17 LTS), We can use two dimensional block of text.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › jdk.jdi › com › sun › jdi › StringReference.html
StringReference (Java SE 17 & JDK 17)
April 21, 2026 - A StringReference is an ObjectReference with additional access to string-specific information from the target VM.
🌐
Reddit
reddit.com › r/java › string.format() is 3x faster in java 17
r/java on Reddit: String.format() is 3x faster in Java 17
October 30, 2021 - Yes, String::formatted is just a non-static variant of String::format. So this optimization applies equally to both. ... That's pretty cool. Highest version Java I've ever seen in the wild in Fortune 500 software is 11. Next project for me is in 8. Hope we get to 17 someday.
🌐
Java Concept Of The Day
javaconceptoftheday.com › home › java new string methods – from java 8 to java 17
Java New String Methods - From Java 8 To Java 17
February 26, 2022 - From time to time, new methods are added to String class so that working with strings becomes effortless and simple. join() in Java 8, chars() and codePoints() in Java 9, isBlank(), lines(), repeat(), strip(), stripLeading() and stripTrailing() in Java 11, indent(), transform(), describeConstable() and resolveConstantDesc() in Java 12, formatted(), stripIndent() and translateEscapes() in Java 15 are some new Java string methods. In this post, we will see all the new methods added to String class from Java 8 to Java 17.
Top answer
1 of 2
2

The error message is produced by an outdated version of CheckStyle.

According to the CheckStyle ticket Support for Java 15 Strings you need at least CheckStyle version 8.36 if you want to use text blocks / multiline strings together with CheckStyle checks.

The error message (org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check) indicates that your project uses the Maven-CheckStyle-Plugin version 2.17 which according to Maven Checkstyle Plugin Releases History by default uses CheckStyle version 6.11.2

You can try to configure your project to use the Maven CheckStyle Plugin 2.17 together with the CheckStyle version 8.36 using the following configuration (source: Upgrading Checkstyle at Runtime):

<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.17</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.36</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  ...
</project>
2 of 2
0

Upgrading the maven-checkstyle-plugin and checkstyle resolved the issue:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-checkstyle-plugin</artifactId>
  <version>3.3.0</version>
  <dependencies>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <version>10.12.1</version>
    </dependency>
  </dependencies>
</plugin>
Find elsewhere
🌐
Javaspecialists
javaspecialists.eu › archive › Issue294-String.format-3x-faster-in-Java-17.html
[JavaSpecialists 294] - String.format() 3x faster in Java 17
One of the most convenient ways of constructing complex Strings is with String.format(). It used to be excessively slow, but in Java 17 is about 3x faster. In this newsletter we discover what the difference is and where it will help you. Also when you should use format() instead of the plain ...
🌐
javaspring
javaspring.net › blog › java-17-string
Java 17 Strings: A Comprehensive Guide — javaspring.net
Java 17, an LTS (Long-Term Support) release, comes with various features and improvements related to strings that can enhance developers' productivity and code readability. This blog post aims to provide a detailed overview of Java 17 strings, ...
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › io › StringReader.html
StringReader (Java SE 17 & JDK 17)
April 21, 2026 - java.io.StringReader · All Implemented Interfaces: Closeable, AutoCloseable, Readable · public class StringReader extends Reader · A character stream whose source is a string. Since: 1.1 · lock · Constructors · Constructor · Description · StringReader ·
🌐
Aegissofttech
aegissofttech.com › home › insights › text blocks in java 17: multi-line string handling tutorial
Text Blocks in Java 17: Multi-Line String Handling Tutorial
October 2, 2025 - READ – Understanding Java 17 Records: Benefits, Features, and Limitations · Multi-line string literals, or text blocks, were introduced in Java 17 to make handling and reading long-formatted texts easier.
🌐
Ideas2IT
ideas2it.com › blogs › java-17-heres-a-juicy-update-on-everything-thats-new
Java 17 New Features: Here's a Juicy Update in JDK17
With JDK17, pattern matching for the instance feature, we can reduce the code to a single line like below, i.e, the variable s is created only when obj is an instance of String, and type casting obj to string happens automatically.
🌐
Yorku
eecs.yorku.ca › teaching › common › jdk17-api › java.base › java › lang › class-use › String.html
Uses of Class java.lang.String (Java SE 17 & JDK 17)
Methods in com.sun.source.doctree that return String ... Returns the text of the comment. ... Returns the text. ... Returns the signature of the Java language element being referenced, as found in @see and similar nodes.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › util › Formatter.html
Formatter (Java SE 17 & JDK 17)
April 21, 2026 - An interpreter for printf-style format strings. This class provides support for layout justification and alignment, common formats for numeric, string, and date/time data, and locale-specific output. Common Java types such as byte, BigDecimal, and Calendar are supported.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › › java.base › java › text › StringCharacterIterator.html
StringCharacterIterator (Java SE 17 & JDK 17)
July 15, 2025 - Constructs an iterator over the given range of the given string, with the index set at the specified position.
🌐
Medium
marian-caikovski.medium.com › strings-how-java-17-is-worse-and-better-than-java-8-59f4088504a3
Strings — how Java 17 is worse and better than Java 8 | by Marian C. | Medium
December 6, 2021 - At the time the authors of the enhancement were not sure if in real applications the overhead of creating and using the novel compact strings can be compensated by their benefits. Sources in the internet suggest that the Java team is still working to deliver even better balance between memory saving and run-time performance. Let’s see how Java 8 and Java 17 differ at string handling.