The Java ecosystem has been slowly dying for years, it's already the new Cobol at this stage. I have the impression that a lot of the mindshare has switched to the Node and Javascript ecosystem, especially the frontend devs, via the Typescript / Angular path, which is a natural path to Java developers due to the comfort given by familiar concepts like static types, classes, etc. When I used to do Java, I always found…
When people say Ruby is dying, it would be more accurate to say they are not growing or they are shrinking. But given the size of Ruby marketshare of less than say ~2%. I would not really disagree with their notion.
But Java? I mean even from a Web Development prospective, given you mention Node, JS and Spring Framework, it is Far from dead.
And this is speaking as someone who likes Ruby and dislike Java.