It's the class file format that has the limit in this case. The package name is a component of the internal binary name of a class. The internal binary name of the class is stored as a constant in the constant pool.
Regarding CONSTANT_Class_info:
The value of the name_index item must be a valid index into the
constant_pool table. The constant_pool entry at that index must be a
CONSTANT_Utf8_info (§4.4.7) structure representing a valid binary
class or interface name encoded in internal form (§4.2.1).
Regarding individual values stored in the constants pool,
The length of field and method names, field and method descriptors,
and other constant string values (including those referenced by
ConstantValue (§4.7.2) attributes) is limited to 65535 characters by
the 16-bit unsigned length item of the CONSTANT_Utf8_info structure
(§4.4.7).
Note that the limit is on the number of bytes in the encoding and not
on the number of encoded characters. UTF-8 encodes some characters
using two or three bytes. Thus, strings incorporating multibyte
characters are further constrained.
If a CONSTANT_Utf8_info can't exceed 65535 bytes, and it has to contain the package name followed by a slash followed by the class name, with a one character class name you could have a package name that's 65533 characters long.
You'd probably need to write your own classloader in order to load the class since it exceeds the limits of any file system or OS that I'm aware of.