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:
The “cannot find symbol” error occurs mainly when we try to reference a variable that is not declared in the program which we are compiling, it means that the compiler doesn't know the variable we are referring to.
Try setting compiler target bytecode version to 11.
Go to Settings
- Build, Execution, Deployment
- Compiler
- Java compiler
and set target bytecode version of your module to 11
You should check following things:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With