I set the JDK 11, it compiles until I use the new method of Java 11 isBlank()
of a String when I use that method this error appears when compiling, I tried cleaning the JDK installations, cleaning caches from IntelliJ, rebuilding but nothing helps. The error is:

- 451
- 1
- 4
- 4
-
2Please edit the question and share the image completely instead of a link. Do let us know, what version of IntelliJ are you using? – Naman Sep 26 '18 at 06:35
-
@starsuper Did you manage to resolve the issue and if so, how? I am having the same problem and have been struggling to find a solution for 3 days now. None of the answers here have lead to a successful build so far. – Setily Nov 22 '18 at 21:30
5 Answers
Set compiler target bytecode version to 11:
Settings
Build, Execution, Deployment
Compiler
Java compiler
- Set target bytecode version of your module to 11

- 7,627
- 4
- 32
- 53
-
2Good addition. I've added a screenshot of these settings to my answer to make it more complete :-) – BitfulByte Sep 26 '18 at 07:49
-
This just got me after updating a project from 1.8 -> 11. Of course, there was only one module affected! Everything in the 'main' settings and per module settings was set to project default (which was 11) and ran fine from mvn cli - don't know how this got out of sync in intellij. – David Bennington Oct 30 '19 at 08:49
-
It worked. Thanks @caco3. One needs to apply the 11 compiler version to all the modules inside the project. – Kartik Narayana Maringanti Mar 17 '20 at 06:57
-
This worked on the IDEA 2020, for older IDEAs, the other answers helped. – jan.supol May 27 '20 at 14:01
-
You should check following things:
- You've JDK11 defined as one of the SDKs:
- Your project's default SDK is JDK11 and your projects default language level is 11:
- Your module language level is also 11.
And if you use Maven, check that your compiler plugin "source" and "target" properties in your pom.xml
are 11. Your module language level configuration is imported from that pom.xml
configuration in such a case
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
or
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
In case your pom.xml
had wrong source or target level you may need to do Right-click | Maven | Reimport after changing that pom.xml
. In case you use Gradle you should check that you have a similar configuration.
Tested with Maven 3.5.4 in IntelliJ IDEA 2018.2.4

- 577
- 3
- 14
-
Note that the OP compile error is showing in the default build tab (compiled with IntelliJ) and not with maven. Good addition though which may be applicable to someone else with similar issues who is using maven. – BitfulByte Sep 27 '18 at 04:47
-
You may still try to build or rebuild your project by IntelliJ IDEA itself, even if your modules are Maven based. – Rostislav Krasny Sep 27 '18 at 09:37
You can use JDK 11 to compile but if you compile against an older version of java, it cannot find that method.
Go to File > Project Structure -> Project
and check the project language level as shown by the arrow in the picture below:
Not working with project language level 10:
Working fine with project language level 11:
Note that I have the following Java Compiler settings (default settings for a fresh new project using IntelliJ 2018.3):
The project bytecode version is same as language level!

- 4,117
- 1
- 30
- 40
-
1The image in the question reads `javac 11` is used. How do you infer that the project level is not set correctly? Downvoted. – Naman Sep 26 '18 at 06:34
-
@nullpointer given that isBlank() is new in Java 11, not having the project language level set to 11 is the most likely cause of the problem. – jwenting Sep 26 '18 at 06:52
-
1@nullpointer I have added screenshot to demonstrate the effect more clearly. It shows the same error as the OP has encountered. – BitfulByte Sep 26 '18 at 07:44
-
That option is beta in my IDE because the 2018.3 version has yet to be released, it should fix the error when the official update is out, but for now caco3 solution works fine. – starsuper Sep 26 '18 at 16:09
-
Yes I'm using a beta version, however the option for project language level is already available for a couple stable releases, what option are you referring to exactly? – BitfulByte Sep 26 '18 at 18:05
-
Project language level is beta for my current installation but in next versions is available. – starsuper Sep 27 '18 at 03:17
-
-
2018.2 in that version it says the 11-Local variable syntax for lambda parameters is beta and you must accept the license, however the program compiles fine by just setting the target byte code to 11, in newer versions all should work fine together. – starsuper Sep 28 '18 at 20:06
I had a similar problem. Got symbol not found for a Java 11 feature. Though everything was set to 11 already.
The solution was that in my Idea settings the Gradle JVM was set to JDK 8. (because I added JDK 11 later)
As sourceCompatibilty
and targetCompatibility
where not set in my build.gradle the gradle daemon (started from Idea) was running and compiling with JDK 8. These properties where dynamically set to 8 (or 1.8).
Telling Idea to set JVM for Gradle to 11 was my solution:

- 61
- 1
- 5
-
Finally a working solution. The key was changing the "Gradle JVM". None of the other solutions worked. Had this problem for a long time. – FraK Dec 24 '20 at 12:25
For my case, it was not even showing 11 in Project language level. So I had to choose X like below screenshot

- 2,531
- 1
- 29
- 42
-
1same with mine as well.. Did you figure out how to get the project language level for java 11? – Seetha Apr 08 '19 at 18:20