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.
Asked
Active
Viewed 2,763 times
6
-
Eclipse does support annotations called `@NonNull`, `@NonNullByDefault` and `@Nullable` – greg-449 Dec 12 '13 at 16:49
-
some of our developers use intellij and some eclipse so do maintain consistency i would need to use intellij annotations – user2707760 Dec 12 '13 at 16:53
1 Answers
9
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:
-
can you give me a link where i can find the jar you are referring to ? thanks – user2707760 Dec 12 '13 at 16:50
-
@user2707760 the Maven repository I linked to contains just the binary jar, [Intellij's source repository](http://www.jetbrains.org/display/IJOS/Source+Repository+Layout) contains the sources – fvu Dec 12 '13 at 16:54
-
Thank you for your informative answer, but... I just downloaded 3+GB of stuff just to get 4KB of source code. Note to others: after you download, the two annotations are in idea/platform/annotations/java8/src/ – Douglas Held Apr 27 '17 at 10:05
-
@DouglasHeld why didn't you just go to https://github.com/JetBrains/intellij-community/tree/master/platform/annotations/java8/src/org/jetbrains/annotations ? ;-) – fvu Apr 27 '17 at 14:14
-
Because http://www.jetbrains.org/display/IJOS/Source+Repository+Layout is what you linked in the comment above. But really, thank you as this led me to the information I needed. – Douglas Held Apr 27 '17 at 16:06