Java and Go both have very wise ideas about how packages are namespaced and imported.
Java's only mistake was not forcing everyone to have version integer for backwards incompatible changes into the package path, the way Go eventually did with modules. Well, the other out-of-language mistake was not waiting for or providing something like GitHub and GitHub Pages with per-package subdomains.
The "but why should I have a domain name for my packages?" isn't a Java problem, that's a society problem. There's no reason why we can't have a world where every human can easily and for free get new domains for stuff. They don't need to be vanity domains, in fact you often wouldn't want them to be - I like getting my packages from a known public repository domain which is secured and managed by at least one really dedicated and really careful widely trusted party. So there's really no good reason besides lack of societal vision for there not to be at least one repository located at a domain like example.com, where each package gets a subdomain like package.user.example.com - then of course imports paths in Java would look like com.example.user.package.
Notably, this is semantically what you get in Go source, with all of its GitHub URL imports - you start with the domain of a big public code hosting service, then you have a user name, and then you have a repository name. Except in Go the price of this wisdom is steeper: less regular syntax, because you're coupling to two different paradigms of hierarchical names instead of just one - not just DNS-like but also HTTP-like.
Which, on a side-note, is all a great example of what happens when you implement part of the vision without implementing every other part of the vision - most of the time, no one will implement the rest of the vision, because most people will not see the vision or how it will improve their lives until after they are using it. And your explanations will be lost, largely unshared and unrepeated. If Java's makers could've also made a good VCS and GitHub equivalent around the same time, people would've loved Java's style of package namespacing the same way people loved Go being able to import GitHub repo URLs.
Anyway, it's extremely good for packages in code to be unambiguously namespaced in a hierarchical namespace that is also unambiguously locating outside the code.




