In the world of tech trends develop and die very quickly. Like the game of life.
Java is stable.
Java has TONS of libraries.
Java is backed by Oracle.
Java runs across all OSes, in web pages, on server-side etc…
People think that Java is “insecure” because of the wide availability of attacks. It has frequent updates, to mitigate this. Hackers target it because it is so ubiquitious. Not because it is inherently insecure.