I started Java 11 yesterday, I downloaded the JDK , made to Environment variables of PC(windows), created a new project and set up the JDK and JRE to point to the Java 11.
I even checked my Env Variables again by echo %JAVA_HOME%
in cmd , it is fine.
Every things seems ok but my compiler is not recognizing @Notnull var
, can someone help!
Basic program i am trying to execute:
list.stream()
.map((@Notnull var s) -> s.toLowerCase())
.collect(Collectors.toList());
Error is:
Error:(13, 24) java: cannot find symbol
symbol: class Notnull
location: class Main
Have even changed the language level in Project structure by
Ctrl+Shift+Alt+S
toX-Experimental features
, but nothing helps.Tried checking
import java.lang.*;
and found that@Notnull
is not there too.
JEP 323 provides the syntax to use annotations on lambda parameters.
There is no class named Notnull
, or NotNull
, or NonNull
. The use of “ @Nonnull
” in JEP 323's text is just an example of how a theoretical annotation might be used.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.