【发布时间】:2016-09-21 07:29:46
【问题描述】:
目前正在研究Java8的新特性:http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
从上面的链接可以清楚地证明:
Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.
但是当我尝试在Eclipse Neon 中添加@NotNull 或@Readonly 等类型注解时,它根本无法识别这些注解!这太令人沮丧了。
我错过了什么吗?或者如果我需要做更多的配置,比如添加额外的 jar,为什么这仍然被列为 Java 8 的新特性?
【问题讨论】:
-
你的eclipse中配置java8了吗?
-
我想是的,因为我的代码包含很多 lambda 表达式,而且它们无论如何都被接受了
-
认为这还不够。你应该知道的
-
其实我也不知道为什么
-
请添加您项目的屏幕显示
标签: java java-8 type-annotation