---
title: "What does \"Syntax error, insert Dimensions to complete ReferenceType\" mean in Java?"
description: "The Eclipse compiler found an array type or creation that is incomplete. Add the missing brackets or size, or remove the stray bracket or dot."
url: "https://bugsee.com/answers/java/insert-dimensions-to-complete-referencetype/"
---

# What does "Syntax error, insert Dimensions to complete ReferenceType" mean in Java?

The compiler found a type that looks like an array but is incomplete, such as `new String[]` without a size or initializer, or a stray `[` or `.` in a declaration. Complete or remove it.

This message comes from the Eclipse compiler (JDT). It appears when the parser expects array dimensions and does not find them.

```java
String[] a = new String[];            // missing size or initializer
String[] b = new String[3];           // size
String[] c = new String[] {"x", "y"}; // initializer
String[] d = {"x", "y"};              // shorthand in a declaration

int[][] grid = new int[3][];          // only the first size is required

List<String[]> rows = new ArrayList<>();   // an array type as a type argument is fine
```

- Look at the line the error marks and the one before it for an unbalanced bracket or parenthesis.
- Check a method signature such as `main(String args[]` for a missing closing parenthesis.
- Primitive types cannot be generic arguments, so `List<int>` needs `List<Integer>`.

## Related questions

- [How do you fix "error: not a statement" in Java?](https://bugsee.com/answers/java/error-not-a-statement/)
