Superpackages

Superpackages are a new language construct being defined by JSR 294, see the draft specification.

Declaring Superpackages

At this time support for superpackages is not yet implemented in the javac compiler. As a temporary workaround, the Modules project uses class declarations of the following form to emulate superpackage declarations. The class is compiled by javac like any other class in the module.

File [location]/super_package.java:

package [superpackage name];

import java.lang.reflect.Superpackage.*;

@[superpackage annotations]
class super_package {

    exports [exported types];

    uses [required superpackages];
}

For the list of exported types and required superpackages, replace the character '.' with '$', for example java.se becomes java$se.

As soon as superpackages are implemented at javac, proper superpackage declarations will be used.