[英]JEP 323 Where is @Notnull in java-11
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. 昨天我启动了Java 11,下载了JDK,将其制作为PC(windows)的Environment变量,创建了一个新项目,并将JDK和JRE设置为指向Java 11。
I even checked my Env Variables again by echo %JAVA_HOME%
in cmd , it is fine. 我什至在cmd中通过
echo %JAVA_HOME%
再次检查了我的Env变量,这很好。
Every things seems ok but my compiler is not recognizing @Notnull var
, can someone help! 一切似乎都很好,但是我的编译器无法识别
@Notnull var
,有人可以帮忙!
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.甚至通过
Ctrl+Shift+Alt+S
将项目结构中的语言级别更改为X-Experimental features
,但没有任何帮助。Tried checking
import java.lang.*;
尝试检查
import java.lang.*;
and found that@Notnull
is not there too.并发现
@Notnull
也不在那里。
JEP 323 provides the syntax to use annotations on lambda parameters. JEP 323提供了在lambda参数上使用注释的语法。
There is no class named Notnull
, or NotNull
, or NonNull
. 没有名为
Notnull
, NotNull
或NonNull
。 The use of “ @Nonnull
” in JEP 323's text is just an example of how a theoretical annotation might be used. JEP 323文本中使用“
@Nonnull
”仅是如何使用理论注释的一个示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.