简体   繁体   English

为什么javax.annotation pacakge在jdk 8中没有类型注释?

[英]Why javax.annotation pacakge dose not have type annotations in jdk 8?

I'm try to run some code from the internet which uses type annotations with Intellij IDEA, thelanguage level and JDK is java 8: 我尝试从Internet运行一些代码,该代码在Intellij IDEA,语言级别和JDK使用Java 8的情况下使用类型注释:
problem snap shot the javax.annotation package dose exist yet the type annotations can not be imported, how can I solve this problem? 问题快照已存在javax.annotation包,但不能导入类型注释,如何解决此问题?

You don't have the jar that contains this class. 您没有包含此类的jar。 Add FindBugs to your pom.xml/ your classpath. 将FindBugs添加到pom.xml /类路径中。

<dependency>
    <groupId>com.google.code.findbugs</groupId>
    <artifactId>findbugs</artifactId>
    <version>3.0.1</version>
</dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM