Cannot `import static` static nested class?

This won't work if A is in the default package. However, you could add a package declaration:

package mypackage;

and use

import static mypackage.A.B.*;

The static import syntax from from the JLS is given:

SingleStaticImportDeclaration: import static TypeName . Identifier ;

where TypeName is required to be full qualified.

In Using Package Members the static import syntax is given with package name included:

import static mypackage.MyConstants.*;

It is recommended to use static imports very sparingly.