Also that whole "Android" thing happened.
Yeah, and Google made their opinion of Java quite clear by adding first-party support for Kotlin.
As for Java being popular because it has mindshare, you are agreeing with my original point. It doesn't continue to exist because it's a good language. It continues to exist because of inertia.