Before you post "stop using newer java", this thread isn't meant exactly for that - it's more that I'm curious, so this is more an essay than a complaint or anything.
The last time I've been heading into the guts of Forge-modded Minecraft was before I started an apprenticeship, however I recently caught the news that Java 15 now saw the light of the day - and that there's a new garbace collector coming with it (sort-ish).
The collector I'm talking about is the Z-Garbage Collector, but I won't go into details about it. If you're curious as well, go here (I think it's super intriguing!).
And as all things go, curious me installed the latest openjdk version (can't be bothered to take the Sun JRE - yet), just to be greeted with what had been coming with Java 11 (?): Nashorn is no more! And, well, as was my Minecraft process.
Forge's Coremod Engine appears to depend on it in some way.
In particular, it appears that loading coremods is what causes the coupling, which is surprising for me.
Well, I did some more research.
I started out with looking for the CoreModEngine class on GitHub, only to find it not being located in Forge itself.
Then were does it come from? Here!
But what does this mean for Forge? Well, I think it is safe to say that Forge depends on the CoreMod part. This means that if Forge considerd to add support for newer Java versions, the CoreMod part would need to be updatet.
Updating, however, doesn't necessarily mean that Nashorn must be replaced!
OpenJDK has a repo up for Nashorn exclusively, you can check it out here.
Whether or not that will be enough for the module stuff introduced in a version after 8 (lost interest in Java around that time) is something I cannot assess, however I think that we might be able to, well, actually do that.
If this cannot be done for some reason my lacking experience disallows me to comprehend, well, it'd mean that the respective could would need to be replaced, which seems like a PITA, just judging from what I have seen so far.
But that sums it up for this post!