This is my first encounter with the term. (in JLS, sect. 7.3) Sounds like a program, but I'm sure there is more meaning underlying the term.
CompilationUnit is the goal symbol (�2.1) for the syntactic grammar (�2.3) of Java programs. It is defined by the following
productions:
CompilationUnit:
PackageDeclarationopt ImportDeclarationsopt TypeDeclarationsopt
ImportDeclarations:
ImportDeclaration
ImportDeclarations ImportDeclaration
TypeDeclarations:
TypeDeclaration
TypeDeclarations TypeDeclaration
Types declared in different compilation units can depend on each other, circularly. A Java compiler must arrange to compile all
such types at the same time.
A compilation
unit consists of three parts, each of which is optional:
1 A package declaration (�7.4), giving the fully qualified
name (�6.7) of the package to which the compilation unit
belongs
2 import declarations (�7.5) that allow types from other
packages to be referred to using their simple names
3 Type declarations (�7.6) of class and interface types
Every compilation unit automatically and implicitly imports every public type name declared in the predefined package
java.lang, so that the names of all those types are available as simple names, as described in �7.5.3.