---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 10 Edition"
java_version: 10
chapter: "Chapter 4. The class File Format"
section: "4.7.17"
heading: "4.7.17. The RuntimeInvisibleAnnotations Attribute"
parent: "4.7. Attributes"
source: https://docs.oracle.com/javase/specs/jvms/se10/html/jvms-4.html#jvms-4.7.17
id: "4.7.17"
url: https://jvm.obfuscated.software/jvms/se10/4.7.17.html
raw: https://jvm.obfuscated.software/jvms/se10/4.7.17.md
---

# 4.7.17. The `RuntimeInvisibleAnnotations` Attribute

The `RuntimeInvisibleAnnotations` attribute is a variable-length attribute in the `attributes` table of a `ClassFile`, `field_info`, or `method_info` structure ([§4.1](4.1.md), [§4.5](4.5.md), [§4.6](4.6.md)). The `RuntimeInvisibleAnnotations` attribute records run-time invisible annotations on the declaration of the corresponding class, method, or field.

There may be at most one `RuntimeInvisibleAnnotations` attribute in the `attributes` table of a `ClassFile`, `field_info`, or `method_info` structure.

The `RuntimeInvisibleAnnotations` attribute is similar to the `RuntimeVisibleAnnotations` attribute ([§4.7.16](4.7.16.md)), except that the annotations represented by a `RuntimeInvisibleAnnotations` attribute must not be made available for return by reflective APIs, unless the Java Virtual Machine has been instructed to retain these annotations via some implementation-specific mechanism such as a command line flag. In the absence of such instructions, the Java Virtual Machine ignores this attribute.

The `RuntimeInvisibleAnnotations` attribute has the following format:

```
RuntimeInvisibleAnnotations_attribute {
    u2         attribute_name_index;
    u4         attribute_length;
    u2         num_annotations;
    annotation annotations[num_annotations];
}
```

The items of the `RuntimeInvisibleAnnotations_attribute` structure are as follows:

- **attribute_name_index**

  The value of the `attribute_name_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be a `CONSTANT_Utf8_info` structure ([§4.4.7](4.4.7.md)) representing the string "`RuntimeInvisibleAnnotations`".

- **attribute_length**

  The value of the `attribute_length` item indicates the length of the attribute, excluding the initial six bytes.

- **num_annotations**

  The value of the `num_annotations` item gives the number of run-time invisible annotations represented by the structure.

- **annotations[]**

  Each entry in the `annotations` table represents a single run-time invisible annotation on a declaration. The `annotation` structure is specified in [§4.7.16](4.7.16.md).
