As seen in DEPEND: dev-java/openjdk:${SLOT} Either way to obtain openjdk:21 now requires magic binaries from wonderland despite already having a previous version (openjdk:17) installed.
https://openjdk.org/groups/build/doc/building.html jdk-21 cannot be bootstrapped with that version. Even so you built openjdk:17 with magic binaries from wonderland. Unless of course you have been building every single major release of jdk so that you can bootstrap the next and so on.
Here’s repo and manual how to do it without magic binaries https://wiki.gentoo.org/wiki/User:Arthurzam/OpenJDK_Bootstrap https://github.com/gentoo-mirror/gentoo-bootstrap We are not going to provide full bootstrap path in gentoo repo this time and probably ever. Too much work and keeping unsupported jdk versions riddled with security bugs is questionable.
What could be done is installing them only to a location where they're used for bootstrapping but not on the system paths. But that still requires someone to do it, of course.
Yeah, it’s possible but not worth it considering there’s perfectly working overlay that provides a patch to bootstrap from pure C and like 5 users. Really old versions also need older broken unsupported gcc. Non-LTS java versions lifecycle is 6 months. Ideally jdk should be able to bootstrap from lts to lts, but that’s hard and is up to upstream.