Is there a way we can use the jetbrains annotations @notnull and @nullable in eclipse ? i tried to search for jars online but could not find them. any help is appreciated.
Enable external annotationsPress Ctrl+Alt+S to open the IDE settings and select Editor | Code Style | Java | Code Generation. Select the Use external annotations checkbox.
Configure an annotation profilePress Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Compiler | Annotation Processors.
From the JetBrains website:
These annotations are proprietary ones and included in the bundled JAR. We at JetBrains suggested to include these annotations in the standard Java SDK. The issue is still pending.
Currently the annotations are distributed under the Apache license. The source code is supplied as well.
So, not only you can use them in Eclipse, you can do so without violating some commercial license. And they're even available in Maven.
However, you may want to read some related questions here on SO:
@Nullable/@NotNull with IntelliJ IDEA, Maven & JSR 305
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