1. There's constantly new frameworks, meta-frameworks, new language features being developed in the JS ecosystem. Some do criticize the churn in JS ecosystem (JS fatigue), but on the positive side it keeps the community active . Conversations around SSR, hydration strategies, reactive programming, functional programming, transpilers keeps the creative juices flowing. On the other hand, Java developers feel stuck on Spring.
2. Python may have lucked out here but pretty much most of the "hot" fields such as AI, ML and data science use Python. Also, Django brings its own die hard fans. If we ever do get to AGI, it will be written in Python. Java doesn't have the allure of having a "hot" field (except maybe big data tools). Neither Java nor any of its libs have have die hard fans or thier voices get drowned in a sea of die hard haters of Java.
3. Lisp and ML languages get praises in their niche ecosystems and have a lot of people that are absolutely in love with the features and the mindsets of those languages
4. C/C++ devs have a shiny new toy in Rust and for good reason too.
Unfortunately, Java just doesn't get the spotlight as much as all these langs. Is there a future for Java when the dev community is giving it such a cold shoulder?
I’m not even a Java dev but I respect its place in the ecosystem and find evangelism quite irritating and normally, has some corporate backer(s).
That said, sometimes life is just based on a feeling that may not always be perfectly rational.
For me, Java feels like it represents a hell of a lot of shitty businesses that I don't want to be associated with. If there's a stereotypical shitty mid-size corporation out there that engages in shitty behavior and manipulates the H1B system and views programmers as fungible cogs and works on the most boring banal shit out there, you know almost without looking at them that they're a Java shop. There's no part of that universe that I want to be a part of. The only thing that made me want to take a half-look at any part of the Java ecosystem for future work is Clojure.
Examples: - frameworks / meta-frameworks: Helidon, Micronaut and Quarkus - new languages features: reactive programming, vector processing, virtual threads, polygon intro (GraalVM) and AOT (compile to native)
There are more standards e.g. Microprofile and more unity in the way it works. Less random projects that come and go with the hype. It's slow and steady. However this also raises the bar to get started.
A lot of Java projects definitely is still "old school" e.g. still uses google groups for discussions compared to say Slack or Discord. This doesn't give it the attention it should.
Its future in some segments is extremely safe while in others it has more competition. Whether it has a future for you depends on the kind of fields you want to work in.
In any case - once you learn a couple of languages (especially from a couple of different paradigms or layers of abstraction) - it becomes easier to pick up new languages.