1

I investigate guava library for java.

reading different materials I faced with @Nullable annotation.

I added guava jar file to classpath but my IDE(eclipse) say:

Nullable cannot be resolved to a type

But if I ctrl + click on Nullable I see blue underline and see next after:

source not found

maybe it is problem with eclipse - I don't know and this annotation located in another location.

But additionally I cannot understand situation when I should to use this annotation.

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

3

It is in here.

javax.annotation.Nullable

I think you need this jar: jsr305.jar.

See also:

https://jcp.org/en/jsr/detail?id=305

http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/package-tree.html

Regarding when you should use it - check this link.

@Nullable annotation usage

Community
  • 1
  • 1
peter.petrov
  • 38,363
  • 16
  • 94
  • 159