---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 18 Edition"
java_version: 18
chapter: "Chapter 6. Names"
section: "6.5.3"
heading: "6.5.3. Meaning of Module Names and Package Names"
parent: "6.5. Determining the Meaning of a Name"
source: https://docs.oracle.com/javase/specs/jls/se18/html/jls-6.html#jls-6.5.3
id: "6.5.3"
url: https://jvm.obfuscated.software/jls/se18/6.5.3.html
raw: https://jvm.obfuscated.software/jls/se18/6.5.3.md
---

# 6.5.3. Meaning of Module Names and Package Names

The module name M, whether simple or qualified, denotes the module (if any) with that name.

This section does not mandate a compile-time error if no module with that name is observable. Instead, the `requires` directive in a module declaration ([§7.7.1](7.7.1.md)) performs its own validation of the module name, while the `exports` and `opens` directives ([§7.7.2](7.7.2.md)) are tolerant of non-existent module names.

The meaning of a name classified as a *PackageName* is determined as follows.

## 6.5.3.1. Simple Package Names

If a package name consists of a single *Identifier*, then the identifier must occur in the scope of exactly one declaration of a top level package with this name ([§6.3](6.3.md)), and that package must be uniquely visible to the current module ([§7.4.3](7.4.3.md)), or a compile-time error occurs. The meaning of the package name is that package.

## 6.5.3.2. Qualified Package Names

If a package name is of the form `Q.Id`, then `Q` must also be a package name. The package name `Q.Id` names a package that is the member named `Id` within the package named by `Q`.

If `Q.Id` does not name a package that is uniquely visible to the current module ([§7.4.3](7.4.3.md)), then a compile-time error occurs.
