Java wasn't particularly responsible for that. And non-GC languages didn't even become obsolete - they're so relevant that they're one of the buzziest new-language-development areas.
It didn't displace C-family languages on desktop OSes. There was a brief wave of Java-first desktop apps and people generally hated the UI toolkits and lack of first-party-feel and they went away.
And on the server, it was just one of many non-C things like Perl, PHP, Python, Ruby, etc. Java became a standard "our dynamic language is too slow, port it to something else" destination but honestly the interpreted languages did more for killing C/C++ from a perspective of "CPUs are fast enough, and we're not CPU bound usually, just write in whatever's easiest."
And now we have a whole wave of "rewrite something off of the JVM, or off of Go, or off of some other GC'd language in Rust" projects because "just let the CPU use the spare cycles to GC has never been fully realized.